Feed on
Posts
Comments

Archive for the 'Unix' Category

remove a user in debian (unix)

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>

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.

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 […]

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 […]

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 […]

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 […]

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

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.

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

apply grep recursively

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”

Next »

More blogs about http://desk.stinkpot.org:8080/tricks.