Linux
Where is my close button?!!
So I just updated to Ubuntu 10.4, and the first thing I noticed is the fact the close/minimize/maximize buttons were switched to the top left hand corner from the right corner. I have no clue why something as standard as that has to be changed, but I guess I’ll get used to it. »
logrotate configured by mere mortals
This will provide a way to implement log file rotations by a non-privileged users using the standard Linux logrotate infrastructure. For our test case, we set up a log file that looks similar to a “normal” log file we may want to periodically roll over. 1 2 3 4 5 6 7 8 9... »
memset example
This is just a quick note so I don’t forget. On linux, you can run what is below to actually *allocate* memory. If you don’t run a memset, the memory will not show as being used in the OS. int main() { int i = 1; while(i++ < 10) { void *m = malloc(100*1024*1024);... »
Delete files older than another file
Using the find command in *nix is very useful. You can specify that you would like to find files newer than another file, or older or newer than a certain time. You cannot (directly) find files older than another file. However, there is a simple step that allows you to do this. Simply add... »
sudo and LD_LIBRARY_PATH … never the twain shall meet
While writing something for our operations support team to use when running a particular process, I found that sudo does not recognize a previously exported value for LD_LIBRARY_PATH. It also won’t use what is in the .bashrc or .profile for the user that owns the script being sudo’d. You also can’t use os.environ in... »
Port checker
This was useful when we testing a migration between database servers. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 import socket import sys for i in range(1,5): try: HOST = "foo" + str(i) PORT = 2484 print HOST + " " + str(PORT)... »
Processor architecture
oracle@kcdb01:~> echo "You have $(cat /proc/cpuinfo | grep "physical id" | sort -u | wc -l) $(cat /proc/cpuinfo | grep cores | head -1 | awk '{print $4}') core processors" You have 2 4 core processors oracle@kcdb01:~> »