Linux Postgres - Output to CSV Quick and dirty export Postgres table to csv file: > psql dbname \f ‘,’ \a \o outputfile.csv select * from table; \o \q
demidecode Dmidecode - Finding Out Hardware Details Without Opening The Computer Case Dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you
Debian Linux Kernel 2.6.24 with iptables 1.4.0, ipp2p -0.8.2 and L7-filter 2.17 Linux Kernel 2.6.24 with iptables 1.4.0, ipp2p -0.8.2 and L7-filter 2.17 [http://www.caronico.com/linux/ipp2p-kernel-2.6.24.html]. The described process below works for Kernel 2.6.24 and has been tested on Debian Etch 4.0 Please note the the
Debian Debian Cheatsheet Use full for VMWare install: apt-get install linux-headers-`uname -r` libx11-6 libx11-dev xspecs libxtst6 psmisc build-essential Fix GPG Errors: NEW_KEY=XXXXXXXXXXXXXX gpg –keyserver wwwkeys.eu.pgp.net –recv-keys $NEW_KEY apt-key add /root/.gnupg/pubring.gpg apt-get update
firewall Iptables and Cisco Some basic rules to allow Cisco VPN clients through firewalls: > iptables -A FORWARD -i $INSIDE_IF -o $OUTSIDE_IF -p 50 \ -s $INSIDE_NET -d $VPN_GW -j ACCEPT iptables -A FORWARD -i $INSIDE_IF -o $OUTSIDE_IF -p udp \ -s $INSIDE_NET -d $VPN_GW –dport 500 -j
grub Grub Commands grub> root (hd0,0) (Specify where your /boot partition resides) grub> setup (hd0) (Install GRUB in the MBR) grub> quit (Exit the GRUB shell)
delete sed - multiple files sed – is useful to find and replace text in single or multiple files. * Replacingfoo with foo_bar in a single file. sed -i 's/foo/foo_bar/g' somefile.module * -i = tell sed to edit the file(s) * s = substitute the following text * foo = what you want to
Debian How to Install Sun Java on Debian Quick Guide If you are fairly confident and don’t want to read the whole document the following summary should probably be enough to get java working on your system. Lines 1 and 3 are preformed as root line 2 as a standard user. apt-get install java-package fakeroot make-jpkg <
iptables Traffic Shaping on Linux Gateway with tc , iptables and ipp2p Original Article here [http://suchart.wordpress.com/2007/12/17/traffic-shaping-on-linux-with-tc-iptables-and-ipp2p/] modprobe ipt_ipp2p tc qdisc del dev eth1 root <== eth1 = internal interface tc qdisc add dev eth1 root handle 1: htb tc class add dev eth1 parent 1: classid 1:1 htb rate 900kbit <== max dl 900
console Kernel Module - netconsole The netconsole kernel module If you do not have the hardware, wich is common because most laptops do not come with a COM port nowadays, you can use the netconsole module wich is very handy. It uses very low level network device calls to send via UDP console output across
Linux Disable Sleep, Hibernation 1, /etc/rc.sysinit …… set 0 in the sleep. 2, /etc/X11/xorg.conf….. Server Layout BlankTime 0 StandbyTime 0 SuspendTime 0 OfTime 0 EndSection setterm -powersave off -blank 0
bind Debian Bind Fix 1.) save your zone and config files 2.) remove the rndc key specification in the /etc/bind/named.conf file aptitude purge bind9 4.) install bind9 again /etc/init.d/bind9 stop 6.) remove rndc.key and rndc.conf rndc-confgen -r /dev/urandom -a rndc-confgen 9.) put the output to
DNS Blocking Malicious Websites with DNS Original article here: [http://getluks.wordpress.com/2009/01/04/transparent-squid-proxy-with-havp-virus-filter/] Using bind we can block malicious websites. apt-get install bind9 vi /etc/resolv.conf make localhost your name server vi /etc/bind/named.conf.options set up your dns forwarders (usually ISP DNS servers) vi /etc/bind/named.conf.
HAVP Squid ClamAV & HAVP Originally from here [http://www.opensourcehowto.org/how-to/squid/squid-clamav--havp.html] HAVP (HTTP AntiVirus proxy) is a proxy with an anti-virus filter. It does not cache or filter content and in this how-to it is set as a parent proxy of squid, i can be run on it’s own.
iptables Iptables Tricks and Tweaks This a general listing of some tweaks to iptables. It may also require extra kernel modules to be loaded. #Kernel sysctl configuration file for Red Hat Linux # # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and # sysctl.conf(5) for more details. # Disables packet forwarding net.
Debian Various Tricks dpkg-reconfigure -phigh xserver-xorg -> reconfigures the xorg server http://www.realvnc.com/products/free/4.1/x0.html http://wiki.debian.org/FluxBox Remove files in a directory when rm won't work: find /home/$u/tmp/ -name '*.wrk' -print0 | xargs -0 rm -f find . -name
.screenrc Screen Tips A few snippets to make your prompt look better when using screen for linux. Add the below to your .bashrc so each tab created when you generate a new screen shows user@hostname function rename_screen_tab () { echo -ne “\x1bk$@\x1b\\”; return 0; } if [[ “$TERM” = screen* ]]; then PROMPT_COMMAND=’rename_
bind How to update DNS through DHCP automatically If you are looking for configuration then you need it as follows: Let us say domain is test.com Domain nameserver, dns (named), samba and most of Linux services servers ip is 192.168.0.1 And network is 192.168.0.1/24 for dhcp ips are 192.168.
Guest Horrid CPU Issues with VMWare and Hardware Interrupts Original Article [http://chadarius.com/node/79] So I fought this problem all day long. My Windows XP VMWare image was running like crap. I started to poke around. The first thing I did was to bring up the task manager. Sure enough, my virtual CPU was pegged at around
Linux Bash tips Originally from here [http://wiki.linuxquestions.org/wiki/Bash_tips]. Contents * 1 Introduction [http://wiki.linuxquestions.org/wiki/Bash_tips#Introduction] * 2 Technologies [http://wiki.linuxquestions.org/wiki/Bash_tips#Technologies] * 2.1 Using quotes [http://wiki.linuxquestions.org/wiki/Bash_tips#Using_quotes] * 2.2 Return values [http://wiki.
exim Exim Tips & Tricks - Unclog your queue! Original article here [http://rootit.org/2008/06/exim-tips-tricks-unclog-your-queue/] This article will focus on some general Exim MTA tips and tricks as well as how to parse mail logs. I originally put this guide together for use with Exim on cPanel. Many cPanel server administrators use the built in Exim
iptables Various Iptables Tricks > iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE > iptables -t nat -P PREROUTING DROP > # Box 1 > iptables -t nat -A PREROUTING -m mac –mac-source 00:50:da:e3:f3:45 -j > ACCEPT > # Box 2 > iptables -t nat -A PREROUTING -m mac –mac-source
cacti check_nt Commands http://www.superk.org/index.php/Nagios_&_Windows [http://www.superk.org/index.php/Nagios_&_Windows] Performance Monitor: Windows NT and better operating systems provided a tool for monitoring many aspects of the Windows operating system called Performance Monitor. Within Performance Monitor there is a wealth of monitoring
cacti Windows Server 2003 Baselining Linux Cacti Original Article HERE [Windows Server 2003 Baselining with the rPath Linux Cacti Appliance ] When trying to diagnose problems with any system one of the first steps should be to looks at differences between the current running values and the baseline for that system. The windows performance monitor exposes many counters
arp SNMP Stuff > Is there a MIB to get the ARP table of a router? Should be one I would > think but can't find it. Yes, .iso.org.dod.internet.mgmt.mib-2.at.atTable.atEntry.atPhysAddress will do what you want. ================= That works but the mib entry is depricated.