Posted in Unix on August 31st, 2008 No Comments »
to remove a user and their home directory, use:
sudo deluser -remove-home <user-name>
to remove all of their files on the server:
sudo deluser -remove-all-files <user-name>
Posted in Unix, Webserver on August 26th, 2008 No Comments »
to setup my server to use a static ip address i edited the file /etc/network/interfaces to include the lines:
iface eth0 inet static
name Ethernet LAN card
address 192.168.2.100
netmask 255.255.255.0
broadcast 192.168.2.255
network 192.168.2.0
gateway 192.168.2.1
of course, whomever provides you with your static IP address should also be giving you the appropriate information to fill in here.
Posted in Perl, Unix on May 13th, 2008 No Comments »
let’s say you’ve got a string and you’d like to count the number of times some substring appears in it. let’s also assume that you’re lazy and you don’t want to leave your shell terminal to do it. fortunately, there’s an easy way to count string matches from the command-line using a perl one-liner. let’s […]
Posted in SVN, Unix on February 27th, 2008 No Comments »
i received the following error message while trying to build subversion the other day:
/usr/bin/ld: /home/ldavid/src/subversion-1.4.6/neon/src/.libs/libneon.a(ne_request.o): relocation R_X86_64_32 against `a local symbol’ can not be used when making a shared object; recompile with -fPIC
/home/ldavid/src/subversion-1.4.6/neon/src/.libs/libneon.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [subversion/libsvn_ra_dav/libsvn_ra_dav-1.la] Error 1
the solution i found:
first, add the following to […]
Posted in Unix on February 27th, 2008 1 Comment »
if you don’t have a sudo account that doesn’t mean that you won’t be able to compile and install code from source. it turns out that all you need to do is set the prefix ./configure flag to a directory that you’ve got write-access to, and then you’re set to go. i found this extremely […]
Posted in Mac OS X, Unix on February 22nd, 2008 No Comments »
it’s unfortunate, but exposureplot doesn’t run for the mac. don’t fear though — if you’d like to find the distribution of focal lengths you use in your photos, all you need to do is the following:
1) install jhead. if you’ve got http://www.macports.org/ installed, it’s as easy as:
>> sudo port install jhead
2) love unix. navigate […]
Posted in Unix on February 13th, 2008 No Comments »
a reasonable way to first try and compile source code that someone has handed you:
1) navigate over to the source directory.
2) >> ./configure
3) >> make
4) >> make install
Posted in Unix on November 14th, 2007 No Comments »
to change the default unix or linux login shell, use the chsh command:
>> chsh
then, type in /bin/bash if you want the bash shell to be your default, or /bin/csh if you’d like the c-shell, etc.
Posted in Shell Scripting, Unix on October 31st, 2007 No Comments »
to measure how much time a program takes to execute from the command-line, use the ‘time’ function.
for instance, to time the ‘date’ command:
>> time date
Wed Oct 31 14:12:41 EDT 2007
real 0m0.003s
user 0m0.000s
sys 0m0.002s
Posted in Unix on August 5th, 2007 No Comments »
i was always too dumb to get the “-R” option of grep working correctly so that i could apply grep recursively. finally, i came across a simple workaround that uses find and xargs:
find ./ -name “*.py” | xargs grep “my_pattern”