I’ve got a hellacious project due and finals all next week, but this was just too much fun to pass up. In any case, compiler optimization increases compile time, and anything that gives me more time to sword fight on $1000 office chairs is worth a little R&D.
I’m working on writing this cut-down MIPS processor simulator for my Computer Organization class at UCF. I googled “word alignments” to help me better understand the most efficient calculations for converting the Byte Aligned Program Counter address to the Word Aligned Memory array when I ran across an interesting article showing that the mere *order* of variable declarations in a C program can affect the amount of memory used by that program.
The article explained the situation very well, and it makes sense why this issue would happen, but I was surprised that the compiler wouldn’t try to optimize situations like this by re-ordering a set of concurrent variable declarations of alternating data types.
In any case, I continued to hack away at my project when I began to think about whether or not gcc translates multiplication and division operations where one of the operands is a power of 2 into simple . . . → Read More: gcc Optimizations for Arithmetic Operations using Bit Shifts
A couple of months ago I setup a cron job to automatically create timestamped snapshots of my zfs filesystem. Little did I know, there was a syntax error preventing my job from actually executing. Here’s the correct (yet not-so-intuitive) cron job to get a nightly, timestamped snapshot of the ZFS filesystem @tank@:
Michael Altfield
Hi, I’m Michael Altfield. I write articles about opsec, privacy, and devops ➡
So, I got into a discussion with a friend of mine in my Computer Security class at UCF about this script. I’m posting this for historical and educational purposes only. As always, I never condone the implementation of any of my content for malicious intent. Moreover, this script has flaws that * would make it useless in such a scenario. Don’t do it!
Here’s a script I hacked up last semester when I was playing with MITM attacks and packet eavesdropping with ettercap:. This scripts will automatically:
fake its MAC Address get a new IP Address collect a list of hosts on the same subnet as itself iterate through and ARP poison: each of these hosts one at a time for 5 minutes each save all data collected in host-specific files in a timestamped directory repeat until the hard drive is full Michael Altfield
Hi, I’m Michael Altfield. I write articles about opsec, privacy, and devops ➡
I really should be studying for my stat exam tomorrow, but I was logging into my.ucf to download my lecture notes, and while Blackboard Learning System (the really shitty replacement for WebCT) was stuck in an infinite loading loop (most probably caused by incompetent javascript) I decided to finally get Google Chromium (which apparently has an excellent javascript engine) working on my Sabayon Linux desktop.
Michael Altfield
Hi, I’m Michael Altfield. I write articles about opsec, privacy, and devops ➡
Quite often, and for whatever reason, I go to play a sound in linux and I get a “device or resource busy” error. Restarting alsasound doesn’t work. Here’s what does:
I recently setup a cheap terrabyte server with an old Dell 2450, 3 1TB Hitachi drives, and this cheap MnssCool XWT-RC040 4-port Sata ‘high speed’ PCI Controller Card.
The best thing about this card was that it was cheap. I got it for $30 off of newegg. The worst part was that it pretty much comes broken. You have to flash the bios to make it work well.
Michael Altfield
Hi, I’m Michael Altfield. I write articles about opsec, privacy, and devops ➡
So, xen is really beginning to piss me off. I turned off all my machines to do a snapshot, and when I tried to bring them back up, they were all in the ‘blocked’ state. Upon further investigation (using virt-manager/xm console), I found that they were hung at the “Checking for hardware changes” item in their boot process. This could be a CentOS/RHEL 5 issue, but I’m putting my money on xen.
Michael Altfield
Hi, I’m Michael Altfield. I write articles about opsec, privacy, and devops ➡
I’ve been playing around with SELinux at work recently. Not surprisingly, I was struggling to get SELINUXTYPE=strict to work properly. Unfortunately, all “google results for ‘enabling selinux strict’ would return were dead ends. People would enable selinux strict, kernel panic, and ‘fix’ it by disabling selinux.
Well, a co-worker of mine *was* able to successfully enable selinux’s strict policy on RHEL5 (CentOS 5). He gave me this guide to post to the world for others to see how (thanks Mykola):
Michael Altfield
Hi, I’m Michael Altfield. I write articles about opsec, privacy, and devops ➡
Storage is getting so cheap these days. So cheap, in fact, that multi-terabyte home servers are now economically feasible.
The emergence of cheap 1 terabye hard drives and ZFS perfectly compliment each other. Like others, I’ve embraced these two technologies to build myself a redundant, multi-TB disk array with 3x1TB drives running in a RAIDZ on OpenSolaris for about $300.
Michael Altfield
Hi, I’m Michael Altfield. I write articles about opsec, privacy, and devops ➡