Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, March 23, 2010

List Installed Packages (with file sizes) - Ubuntu


dpkg --get-selections | awk '{printf("echo \"%s:\"`sudo aptitude show %s |grep \"Uncompressed Size:\"` \n", $1, $1 );}' >output.sh
sh output.sh| awk -F: '{printf("%s:%s\n",$1,$3);}' >list.txt
rm output.sh

Monday, February 22, 2010

ubuntu hamachi

There is no .deb in the ubuntu 9.10 rep for hamachi or quamachi. Have no fear, you can install it via the autopackage system. Just download the .package files and satisfy dependencies, and run the package files.


1. Go to http://code.google.com/p/quamachi/
2. download hamachi and quamachi, ex:
http://quamachi.googlecode.com/files/quamachi-0.4.1-1.package
http://quamachi.googlecode.com/files/hamachi-0.9.9.9-20.package
3. sudo apt-get install python libqt4-core python-qt4 pyqt4-dev-tools upx-ucl grep bash make
4. chmod 777 hamachi-0.9.9.9-20.package
5. chmod 777 quamachi-0.4.1-1.package
6. sudo ./hamachi-0.9.9.9-20.package
7. sudo ./quamachi-0.4.1-1.package

Friday, September 11, 2009

rsync -C or --cvs-exclude

rsync -C option excludes .exe files by default so if you want to rsync .exe files add in
--include=*.exe

Which filetypes does cvs ignore? Then.. which filetypes does rsync ignore ontop of the cvs ignores. From man pages (man rsync):


-C, --cvs-exclude
This is a useful shorthand for excluding a broad range of files that you often don’t want to transfer between systems. It uses a similar algorithm to CVS to determine if a file should be ignored.


The exclude list is initialized to exclude the following items (these initial items are marked as perishable — see the FILTER RULES section):


RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/ .git/ .bzr


then, files listed in a $HOME/.cvsignore are added to the list and any files listed in the CVSIGNORE environment variable (all cvsignore names are delimited by whitespace).


Finally, any file is ignored if it is in the same directory as a .cvsignore file and matches one of the patterns listed therein. Unlike rsync’s filter/exclude files, these patterns are split on whitespace. See the cvs(1) manual for more information.


If you’re combining -C with your own --filter rules, you should note that these CVS excludes are appended at the end of your own rules, regardless of where the -C was placed on the command-line. This makes them a lower priority than any rules you specified explicitly. If you want to control where these CVS excludes get inserted into your filter rules, you should omit the -C as a command-line option and use a combination of --filter=:C and --filter=-C (either on your command-line or by putting the “:C” and “-C” rules into a filter file with your other rules). The first option turns on the per-directory scanning for the .cvsignore file. The second option does a one-time import of the CVS excludes mentioned above.

Monday, July 20, 2009

Crontab daily gui app launcher, and taskkill

10 17 * * 1-5 killall pidgin
8 10 * * 1-5 if ! ps -C pidgin > /dev/null; then export DISPLAY=:0 && pidgin; fi

Monday, June 08, 2009

smbfs smbmount are deprecated, use cifs

mount -t cifs -o username=guest \\\\192.168.0.97\\share /home/share-buff/

Thursday, April 02, 2009

setup vnc server on fedora


# assume we are setting it up to vnc as bsmith
su -

# as root: verify current ip address
ifconfig

# as root: install if needed
yum install vnc-server

# as root: uncomment out 2 lines, replace myusername with bsmith
vim /etc/sysconfig/vncservers

# as bsmith: set vnc password
vncpasswd

# as root: generates ~/.vnc/xstartup
service vncserver start

# as root: sets service to startup with machine
chkconfig vncserver on

# as root: uncomment out line 4 and 5
vim /bsmith/.vnc/xstartup

# as root: applies settings
service vncserver start

# as root: open up port in firewall, note vnc is insecure by protocol
vim /etc/sysconfig/iptables

# as root: apply firewall changes, vnc=insecure so better to use over lan
service iptables restart

Thursday, February 26, 2009

please mount the unreal tournament play disc cdrom - ut2004 on ubuntu fix

I was trying to install ut2004 on ubuntu and kept getting the message:
"please mount the unreal tournament play disc cdrom"

I think because ubuntu auto-mounts volumes, it mounts them in multiple places, somehow confusing the installer. The answer is to umount it... then manually mount it below as shown.

sudo apt-get install libgtk1.2
umount /media/cdrom
sudo mount /dev/cdrom /media/cdrom
export SETUP_CDROM=/media/cdrom
/media/cdrom/linux-installer.sh
... let it install ...
umount -f /media/cdrom

Note: installing libgtk1.2 is just to have a gui installer instead of console/ascii looking installer

it worked for me.

linux bash xargs cut convert usage

Convert all PSDs to PNGs:
ls *.psd | cut -d . -f 1 | xargs -L1 -i convert {}.psd {}.png

Thursday, February 12, 2009

view rpm binary content

rpm -qpl [package.rpm]

geoip lookup

opensuse 10.3 linux rpm
http://download.opensuse.org/repositories/games:/tools/openSUSE_10.3/i586/


data available from:
http://www.maxmind.com/app/geolitecountry
http://www.maxmind.com/app/geolitecity

Wednesday, February 11, 2009

echo tabs in bash

The -e turns uses escaped characters like \t \n \r instead of treating them literally which is default.
echo -e "FIRSTNAME\tLASTNAME\tOCCUPATION"

Wednesday, January 28, 2009

how to lookup current linux version command line

uname -a
cat /etc/issue
cat /proc/version

Friday, January 23, 2009

Saturday, January 10, 2009

How to mount an iso in linux

How to mount an iso in linux

1. make some folder
mkdir /mnt/iso1


2. as root...mount it
mount -o loop abc.iso /mnt/iso1

Friday, January 09, 2009

A8V-VM SE sound on linux

How to configure the onaboard ALC861 sound on the A8V-VM SE motherboard in opensuse:


in opensuse 11.1 set 'model' option to 3stack in yast2

Tuesday, December 16, 2008

to extract any rpm:

to extract any rpm:

rpm2cpio some.rpm | cpio -id

Friday, December 05, 2008

mount a samba fileshare in linux

how to mount a linux samba fileshare back into another linux box

edit /etc/fstab, add the line:
//host/shared/ /home/shar/ cifs username=u,password=p,_netdev,uid=root,gid=users 0 0

replace host with [host]
/shared/ with the folder shared
/home/shar/ with where you want to mount it
u with the samba username
p with the samba password

(when complete, 'mount -a' should apply the fstab changes).

Wednesday, November 19, 2008

linux disk usage

du -B MB --max-depth=1 |sort -nr

Wednesday, November 12, 2008

linux sort

sort a tab delimited file: on column 2 (where you have column 1,2,3...)

sort -t$'\t' +1 -2 export_1612.txt>sorted.txt

Friday, November 07, 2008

BASH - Time Your Bash Script

#!/bin/bash
time_start=`date +%s`
sleep 63
time_end=`date +%s`
time_elapsed=$((time_end - time_start))
echo $(( time_elapsed / 60 ))m $(( time_elapsed % 60 ))s