I've done a lot of windows programming when I was using the system. I've been creating things I needed back then. Then I moved to use mostly (and then almost exclusively) linux and continued creating things I needed there. I still use linux a lot, of course, but I've also added another system to my everyday life (which, I must admit, I like) — Mac OS X.
I have to admit, there's no particular need in TFTP server and client on OS X, since it has command line tools for these needs, but still sometimes it is more convenient to fire up a nice GUI, especially when it comes to the server.
Anyway, to expand my horizons, learn a bit about the platform I use, dig a bit deeper into Objective-C, etc. I have ported the well-known PumpKIN TFTP daemon to Mac. (Icons were the hardest part).
This is the very 0.0 version, but it seems to work. And feedback is appreciated if anyone cares to try.
Love,
H
Склоняя на все лады разнообразные числительные к сожительству с разнообразными существительными во всевозможных падежах, я решил что человечество вправе об этом знать, а то и присоединиться. А то и сказать мне как я обосшибся.
Ежели кому-то хочется или нужно повторить подвиг, то этот кто-то, будучи не ленивым, может даже стырить код, это не трудно.
There are some things that are awfully out of fashion, that I still do. One of those things is maintaining server with its own configuration — personality, if you please. As opposed to maintaining the army of 125000 identical machines (yes, right, the same goes for humans).
That definitely doesn't take any enterprise grade configuration management system unless done in corporate environment, due to the lack of managers to keep confused. For tracking configuration files one can get away with widely available tools while nobody sees. In particular, I like putting files in git repository.
So I thought I'd put some snippets here for future reference and copy pasting.
First thing is add a nice alias for the root user (that guy who is in charge of breaking configuration):
alias cfgit='git --git-dir=/var/cfgit --work-tree=/'
Or even
eval $(echo "alias cfgit='git --git-dir=/var/cfgit --work-tree=/'" | tee -a /root/.bash_aliases)
(depending on the distribution). Then initialize and configure the /var/cfgit repository:
git init --bare --shared=0600 /var/cfgit cfgit config core.logallrefupdates true cfgit config user.name root@$(hostname) cfgit config user.email root@klever.net echo /\* >/var/cfgit/info/exclude
Done. Now one can add files to track before breaking the system.
cfgit add -f /etc/tobebroken/ cfgit commit -m 'stock tobebroken package configs'
cfgit add -f /usr/local/bin/mygreatscript cfgit commit -m 'my great script before I broke it'
and so forth…
Rejoice at the damn glad tidings, DHL promises increased security for the PACKSTATION!
Für die Nutzung der PACKSTATION bedeutet dies, dass Sie zukünftig zusammen mit der Sendungsbenachrichtigung stets eine neue mTAN per SMS auf Ihr Handy erhalten. Mit dieser können Sie Ihr Paket dann aus der PACKSTATION entnehmen. Ihre PIN werden Sie zukünftig nicht mehr benötigen.
Previously, to pick up the parcel one needed to combine the possession of the card and the knowledge of the PIN. But the guys have heard about the higher security of mobile TANs (always coupled with PIN or password, the way to bring possession — of the mobile phone — into the equation).
As a result of putting together the possession of this pattern with the lack of knowledge why, starting October 29th they boost security by dropping the PIN authentication (the thing you know) and resorting to the combination of what you have and what you also have.
Oh, Brave New World 2.0!
Дастин Московиц решил продать акции фейсбука. Казалось бы и хрен с ним, но мне попалась новость в которой его назвали «Датин Московиц». Опять, казалось бы — хрен с ним, но я поинтересовался у Яндекса насколько активно продаёт акции Датин Московиц и поспевает ли за ним одноимённый Дастин. Надо отдать последнему должное — поспевает. Супротив десяти тысяч Дастинов, продающих акции, выступили шесть тысяч Датинов.
Казалось бы, ни хрена себе. То есть больше трети доблестных средств сомнительной ценности информации освоили операцию копирования. С этим достижением можно поздравить, но кого?
I'm taking down the bigbrother-1.00.exe that's been lying around peacefully and harmlessly — and hopefully unclaimed — for some 15 years until one day google's machinery didn't come up with the idea of its malicious nature.
Checking the file, requesting a review accompanied by explanation doesn't get one too far, if one is questioning something as magnificent as google's opinion: A review for this site has finished. The site was found to still be dangerous for users. No further explanations. No questions answered.
The file charged for maliciousness is not of a tremendous value for the humankind or myself and I only kept it for the sake of completeness. I do value myself, though, and do not exactly enjoy the treatment received.
It is interesting, though, to see google as a model of humankind or society at any scale — it has accumulated by now the intelligence ranging from utter morons to blindingly brilliant folks and moral attitudes from jerks to saints. And, as usually, vice has all the authority and power derived from virtue's achievements.
Love,
H
Don't. Really. Unless you understand it.
I had an iPhoto library of some 30K pictures — some managed, some referenced and I wanted to consolidate the library — that is to copy the originals (a.k.a. masters) to the iPhoto Library for those photos that were copied with the appropriate preference off. Searching the web, looking at tools seemed to be of no help, so this is where I had to dig into iPhoto library guts and see if I can do it on my own.
It didn't take long to find that the Database/apdb/Library.apdb file and its RKMaster table have the information in question. Thank you, Apple, for adopting the sane standard for the databases, BTW. So, all I had to do is to copy files to the Masters directory (the subdirectory structure there is pretty straightforward — %Y/%m/%d/%Y%m%d-%H%M%S in terms of strftime) and update the database.
The shell script follows (note, that I used the script on linux, where the network storage resides, it may not be compatible with other environments out of the box). What makes it a bit longer than one might expect from the description above is that it puts no more than 2000 files in one directory.
#!/bin/bash ipl="/path/to/your/iPhoto Library.photolibrary" fvuuid="the-uuid-of-the-volume" fvpath="/path/to/the/volume/on/disk" dryrun="echo" cpln="ln" lf="/tmp/masterslist.$$" trap "rm $lf" EXIT sqlite3 "$ldb" "SELECT modelId,imagePath,originalFileName FROM RKMaster WHERE fileIsReference and fileVolumeUuid='$fvuuid'" >$lf \ || { echo "Couldn't fetch the list of images" ; exit 1 ; } while IFS=\| read mid ip ofn ; do [[ -r "$fvpath/$ip" ]] || { echo "$fvpath/$ip not found" ; continue; } [[ -n "$idir" && -e "$mpath/$idir/$ofn" ]] && idir='' [[ -z "$idir" || "$((++nf))" -ge 2000 ]] && { sleep $(((nf=0)+1)) ; idir="$(date +%Y/%m/%d/%Y%m%d-%H%M%S)" ; $dryrun mkdir -p "$mpath/$idir" ; } $dryrun $cpln -v "$fvpath/$ip" "$mpath/$idir/$ofn" || { echo "failed to $cpln $fvpath/$ip to $mpath/$idir/$ofn" ; exit 1; } $dryrun sqlite3 "$ldb" "UPDATE RKMaster SET fileVolumeUuid=NULL, fileIsReference=0, imagePath='$idir/$ofn' WHERE modelId=$mid" \ || { echo "failed to update database to reflect copy of $fvpath/$ip to $mpath/$idir/$ofn" ; exit 1; } done <$lf
Bold parts are the parameters to be modified. To get the uuid of the source volume one needs to peek into the database. It's the second column of the sqlite3 Database/apdb/Library.apdb "SELECT * FROM RKVolume" output.
And again. If you don't understand, don't do it. At any rate, backup what is there to backup. And don't hold it against me if you fail.
Вот и стукнул этим запискам уже год. А мне, соответственно, 39 их же.
И то и другое вещи, разумеется, совершенно бесполезные.
Это я к чему? Это я к тому, что здесь можно дежурно поздравлять и страстно опровергать.
So this thing is now one year old, whereas I turn 39.
The thing, unsurprisingly, is utterly useless. And so am I.
What I'm trying to say is that it's about time to violently disagree and dutifully congratulate.
Not really a breakthrough, but the amount of small changes justifies a release. The new iii now consumes less memory when calculating integrity digest, accepts all files the card is willing to send and complains better when being wronged (the latter is only important if you haven't got it to work yet).
Love,
H
This is the old config snippet I am about to copy from one config to another and, while I'm at it, I thought I'd put it here for future reference.
The good thing about this approach is that almost the whole thing is completely done in the config file and requires almost no setup elsewhere. The bad thing is that I don't think it will perform well on high load. On my MX with approximately 10K incoming connections a day it performs alright.
So, this is how it's done. Exim needs to be compiled with sqlite support, of course. First step is to initialize the database with this table:
CREATE TABLE greylist ( gl_mailid text NOT NULL, gl_hostid text NOT NULL, gl_ctime integer NOT NULL DEFAULT ( strftime('%s','now') ), gl_atime integer NOT NULL DEFAULT ( strftime('%s','now') ), gl_btime integer NOT NULL DEFAULT ( strftime('%s','now') ), gl_ptime integer, gl_blocked integer DEFAULT 1, gl_passed integer DEFAULT 0, PRIMARY KEY (gl_mailid,gl_hostid) );
Then put this (or similar)
GREYDB=/var/lib/exim4/greylist.db
line into main section of exim configuration.
This acl does the whole thing:
acl_greylist: warn set acl_c_gl_mailid = $sender_address+$local_part@$domain set acl_c_gl_hostid = $sender_host_address+$sender_helo_name set acl_c_gl = ${lookup sqlite {GREYDB select *, \ strftime('%s','now')-gl_atime as sincea, strftime('%s','now')-gl_ctime as sincec from greylist \ where gl_mailid='${quote_sqlite:$acl_c_gl_mailid}' and gl_hostid='${quote_sqlite:$acl_c_gl_hostid}'; \ }} # defer strangers defer condition = ${if eq {$acl_c_gl}{} {true}{false}} set acl_c_nothing = ${lookup sqlite {GREYDB insert into greylist (gl_mailid,gl_hostid) VALUES \ ('${quote_sqlite:$acl_c_gl_mailid}','${quote_sqlite:$acl_c_gl_hostid}'); }} set acl_c_gl_message = Come back in some 10 minutes, stranger # accept passers accept condition = ${if >{${extract{gl_passed}{$acl_c_gl}}}{0} {true}{false}} set acl_c_nothing = ${lookup sqlite {GREYDB update greylist SET gl_passed=gl_passed+1, gl_atime=strftime('%s','now') \ where gl_mailid='${quote_sqlite:$acl_c_gl_mailid}' and gl_hostid='${quote_sqlite:$acl_c_gl_hostid}'; \ }} # accept after 12 mins of silence or 3 hours of knocking accept condition = ${if or{\ {>{${extract{sincea}{$acl_c_gl}}}{720}}\ {>{${extract{sincec}{$acl_c_gl}}}{10800}}\ }{true}{false}} set acl_c_nothing = ${lookup sqlite {GREYDB update greylist SET gl_atime=strftime('%s','now'), gl_passed=gl_passed+1, \ gl_ptime=coalesce(gl_ptime,strftime('%s','now')) \ where gl_mailid='${quote_sqlite:$acl_c_gl_mailid}' and gl_hostid='${quote_sqlite:$acl_c_gl_hostid}'; \ }} defer set acl_c_nothing = ${lookup sqlite {GREYDB update greylist SET gl_atime=strftime('%s','now'), gl_blocked=gl_blocked+1, \ gl_btime=strftime('%s','now') \ where gl_mailid='${quote_sqlite:$acl_c_gl_mailid}' and gl_hostid='${quote_sqlite:$acl_c_gl_hostid}'; \ }} set acl_c_gl_message = Come back in some 10 minutes, buddy
Finally, somewhere in acl_check_rcpt it would make sense to call the thing. Something like this:
warn acl = acl_greylist
So the only thing left is a daily cleanup:
DELETE FROM greylist WHERE 3600*24*gl_passed < (strftime('%s','now')-gl_atime);
And, unless I am mistaken (which is not completely unlikely) the greylisting setup is complete.
So Mozilla went crazy releasing firefoxes, so I thought I'd update fireflix to match. And so did.
Bad thing, though, is that I think I've lost the key for signing, I have no idea if it will refuse to update… I'll try to find the key, meanwhile.
But I hope it will make it to addons.mozilla.org soon and this is, perhaps, where most people get it from, anyway.
Yes, it has happened once already when I have released the c++-based web development monster for a speedy development of trivial pages that are better off as a static html. It worked well for a while (and I even have some enhancements never pushed to the public, though I don't think anyone ever used it, anyway). Then I have changed my mind about a year ago and simplified the code further, gaining more freedom and freeing more resources.
Now I've found some time to release this new template preprocessor to the innocent public that doesn't need it again. But do pretend and make the tinimalistic preprocessor feel welcome, even if it's not.
Meet the cliche.
Love,
H
It is very satisfying to know that people, who conduct surveys and publish reports stuffed with epic and emetic infographics (fragment on the left) being linked, relinked, shared, reshared, twitted, retwitted, believed and spread, though never scrutinized or considered, are responsible and competent authors who are able to picture the state of the affairs for a curious reader in the most accurate and sensible way.
I'd even go as far as irresponsibly risking a generalization and hypothesizing that the sample provided is not just an isolated case, but does picture the state of the affairs in the infographics industry for the curious reader rather accurately.