I run an in-house server for myself and some friends and I got tired of manually running backups, by logging in, stopping the server, making the tar.gz file and then moving it around, so I threw together this simple script. It relies upon an active screen session for the server and a named window called Server to be present, but other than that it should be pretty straight forward how to works.
# change the argument for -S to whatever screen -ls says is the right value
# this allows us to target the running screen sessions so if there is a server
# reboot then this script must be updated (until I work out the code to make
# all that happen automatically
screen -S 436.minecraft -p Server -X stuff '/say Preparing for Server Backup
/say please get to a safe area soon (2 minutes)
sleep 2m # this should be 2m when testing is done
screen -S 436.minecraft -p Server -X stuff '/say commencing backup process now
/say this should take about 15 minutes max
/say server is going down NOW!
tar -cf "mc-backup-"`date +%Y_%m_%d`".tar" world*
gzip "mc-backup-"`date +%Y_%m_%d`".tar"
mv "mc-backup-"`date +%Y_%m_%d`".tar.gz" ~/backups
screen -S 436.minecraft -p Server -X stuff './start.sh
It wouldn’t be hard to make the script scp the file to a different server or possibly push to a cloud provider like Dropbox. The key here is that it also brings the server back up so you could very easily make this a completely automatic task if so inclined.
So I have a co-worker on a coding project who has all but refused to use any kind of version control ( and in general prefers to do most of his work in production ) so I’ve been kicking around ways to either force him to do the work, or at least make changes get committed to to a repository without his interaction at all. Took a little reading around to figure out the flags necessary but I managed to get everything working with shared ssh keys added into my bit-bucket settings as well as a cron job that runs at set intervals (in my case at about 10 am when the co-worker’s shift has ended) and pushes all changes including new files to the repository so that I can review what work he has done and the things he has broken. Unfortunately as I got all of this working it seems the web proxy between the server and the outside world shit the bed and I can’t push commits out to my external (and not under the control of the co-worker) repository.
So I can now say that the idea of flattery is not all its cracked up to be, at work I develop some tools that the department uses and to help out my boss and an ‘assistant’ sometimes ‘help’ out. Today that helping ended up being bastardizing code I had previously written that worked just fine. There were lines commented out all over the place, loops within loops (with additional code that wasn’t there before) that just made the whole thing shit the bed when it came time to actually look at what was being created with the code. Turns out they don’t know how to properly format HTML or even how to design something to be efficient; instead of just pulling data for the currently logged in user they created this huge drop-down menu that lists all the users and you pick your name out of that list.
Normally I wouldn’t even bother complaining about this here but the supervisor who so graciously left their name in comments they put into the code claims to have been a programmer at their previous job, however more and more I think they were simply writing SQL queries and using some kind of a front-end tool to format and display everything. Sure that still indicates some level of skill in knowing how to do joins and all the other fancy wizardry associated with databases but it doesn’t indicate any kind of a knowledge about actual programming in general (like not putting things inside loops if it doesn’t need to be there) or even simple things like how to properly utilize html tags to positive effect.
This actually has nothing to do with a year ending so much as it does with wondering where I am in my life and where I am headed.
I spent considerable time learning how to do all kinds of things with computers, from understanding concepts of security to programming, databases, managing virtualization environments and all kinds of other things as well. Despite all of that I work as a Tier 2 Linux Engineer for a massive company; as an employee I generate value for the business and that value translates to a benefit or service to the customers we server but I wonder if that’s really enough to be satisfied with my employment on a personal level.
I know several people who currently program for a living and take part in open source projects and generally contribute to things that lots of people use and derive benefit and profit from. It seems kind of cliche to even think it but I can’t help but wonder if there is more to it than just being that wheel that never squeaks and gets compensated well for said lack of squeaking. Part of me yearns to get involved in something for fun, for enjoyment and the sense of contribution to something larger than myself rather than just working 40+ hours a week to get paid, but at the same time I wonder how to balance that desire to do something bigger against the very real need to earn an income to survive.
Maybe its just the fact that I’m trapped at work on a holiday when I could be with friends enjoying a few drinks, maybe its natural sense of an ending of the year that is stirring thoughts that generally don’t get much time on the front of the stove but maybe its time to really consider what I am doing with myself, my career and life.
If you look at this poster and find yourself nodding in self-affirming-righteousness please do the rest of the fucking world a favor and jump in front of a bus, because meat-sacks like YOU are the reason we have a whole generation of fucking chicken shit spineless worms being raised instead of well adjusted humans who know how to handle their fucking shit!
“If Congress won’t act, we’ll fight for a new Congress,” Biden said. “It’s that simple. But we’re going to get this done.”
Those are the words of Vice President Joe Biden regarding gun control; they simply don’t give a shit that the elected representatives of the people have NOT supported their agenda enough to get it to pass, they will keep pushing until they get their way. Unfortunately there will be no stopping this move as the recently confirmed head of the BATFE Todd Jones is firmly in the pocket of the administration, so much so that Democrats threatened to rewrite the rules of the Senate in order to make sure he got into the position. Make no mistake people they ARE coming for your guns, its just going to be a much slower process than some folks anticipated but they still are pushing the goal of disarmament.
I had started keeping a journal, and I was discovering that I didn’t need school in order to experience the misery of appearances. I could manufacture excruciating embarrassment in the privacy of my bedroom, simply by reading what I’d written in the journal the day before
- Jonathan Franzen
At the beginning of this year I started carrying a cliche Moleskine notebook with me almost everywhere, and trying my best to write at least a sentence in it every day. Some days I would churn out pages worth of thoughts (usually when I was agitated), while other times I would maybe put two sentences total on a page before forgetting about it for the day. Most of the entries were somehow tied to work, if not always because I wrote at work when I couldn’t talk to someone else or distance myself from things that bothered me because I had several hours left to go on my shift. When you can’t discus something and you can’t escape it the only way really to stay sane it seems is to express your thoughts in a way others wont notice; in my case it tends to be writing because its something people simply don’t do anymore.
EDIT: So according to this it was an employer that tipped off the police, but my rant still stands
Michele Catalano was looking for information online about pressure cookers. Her husband, in the same time frame, was Googling backpacks. Wednesday morning, six men from a joint terrorism task force showed up at their house to see if they were terrorists. Which prompts the question: How’d the government know what they were Googling?
I wish I could say this was from The Onion, or maybe some other satirical blog but sadly its a real
thing. The picture above this from the confrontation by ‘local police’ with the Catalano family, all over what two people (probably on different computers in different rooms) searched for. Backpacks and Pressure cookers are now verboten searches under the watchful eyes of the National Security Agency it seems and if you look for them too close together you will be paid a visit. Since I fit the profile of most ‘lone wolfs’ I wonder if they would visit me if I started reading up on pressure cookers for canning (cause hey, who doesn’t like to save some money) and camping packs because I work a sedentary IT job and should probably get out of the house more often and into nature for exercise.
I can’t even really properly express how angry and sick this story makes me. We are lead to believe that we are having our privacy forcefully taken for our own good, yet supposedly there are 99 out of 100 incidents where this was just a wild goose chase initiated by an over-zealous spy agency who gets its jollies off monitoring every single thing we do online. At this point I am angry at more people than I can count; Congress for letting this happen and implicitly endorsing it, and the people of the country as a whole for not demanding and GETTING an end to this blatant violation of our rights. We have had larger protests over more niche issues like gay rights or abortion than things that impact all of us like PRISM and the spying on of every single man, woman and child in this country. If that doesn’t show the cracks in the foundation of our society then I don’t know what does; our priorities are so screwed up we can’t even see the water as it continues to boil us collectively. Sadly I know this rant falls on deaf ears; chances are one day my nephew or his children will look back and wonder why we left them such a fucked up world and the only mercy will be that I wont be alive to have to try to make some kind of excuse for why my generation proved to be the most spineless in the history of the nation and failed to right a terrible wrong when we had our noses rubbed in it like a dog who shit in the house.
So I came into work today and my inbox had a wonderful little gift; a co-worker had made changes to some of my code that was considered production without providing me a log of what changes he made, just a general not of what sub-folder might contain changes that were naturally NOT included in the git repository. Naturally I was so pissed about this that I considered doing bodily harm to inanimate objects while screaming profanity, then I got busy actually finding all the things he changed. All I had to work from was the bash history showing me every file he touched, so I manually diff’ed them against files from the repo that I knew he hadn’t touched only to find out he did more looking than touching, but that was probably a godsend really once I realized he was changing commented out code (hope he didn’t expect to see anything actually change).
After I got all the non-changes found and replicated in the repo by hand (obviously hes not up to speed with such things as version control) I decided I was done fucking around with undocumented changes to live production code which could have all kinds of nasty consequences, thus the following quick and dirty script was created.
# author: dword
# purpose: generate daily md5 sums of files and email them off for tracking of changes
# Lets generate the msg file, not used currently but will be later
echo "*** Daily Integrity Report ***" > int.msg
echo " " >> int.msg
echo "Generated: " >> int.msg; date >> int.msg
# Now to tag the log with today's date
date > int.log
# Generate MD5 sums for every file we want to track
for f in $(find /var/www/html/); do md5sum $f >> int.log; done
# Mail it off!
mail -s "Daily Integrity.sh Report" firstname.lastname@example.org < int.log
# Clean up files
Just change the path that find uses to whatever location you would like to keep track of and make the email actually something that works, slap it in a @daily crontab and you should be golden. Its not anything fancy like tripwire or the like but at least hopefully it will save someone else from having to do a bunch of manual work diffing files wondering which were edited and which were just looked at. I would have liked to simply lock the reject out who managed to cause this whole mess in the first place but I don’t think the boss would appreciate me circumventing the chain of command to start decreeing who works on what, even if they are total morons who probably shouldn’t be allowed to touch production systems in the first place.