- Published:
- October 16, 2009 – 9:12 am
- Author:
- By Dave
Did you ever have a situation where you needed to access a website that had an IP restriction in place? I recently had a situation where I needed to access the web via my university connection (due to IP restrictions placed on accessing databases of research papers). They do not have a VPN setup so it is hard to do this off-campus. I do however have access to a linux machine on campus. I am familiar with port forwarding using SSH but I had never used it to actually tunnel web traffic using a web browser on Windows. Turns out it is surprisingly easy! The ssh command to use is: 1ssh -C2qTnN -D 8080 username@remote_host This command sshes to the remote_host, and creates a tunnel on your localhost, port 8080. Note that you need to have private key authentication already set up for this host – it will not work….
Categories: CentOS,Linux,Security,Software,System Administration,Ubuntu
Tagged: Linux, proxy, Shell, VPN
- Published:
- July 21, 2009 – 9:57 am
- Author:
- By Dave
Have you ever come across a server that is doing a lot of traffic? Maybe you have logged in to see a process running at 100% CPU, so you know the culprit, but instead of kill -9ing it, wouldn’t it be great to see what exactly it is up to? Or even if you see a process and don’t know exactly what it is doing, and you are just curious what it is up to? As with most issues there are several ways to skin this cat. You can use tcpdump or wireshark to sniff the all of the network traffic on the device. If you know the port the program is running on (you can use lsof for that), you can restrict traffic to that port. But what if the program is jumping ports, or even uses a side-port for some sort of data transmission (UDP?). The main problem….
Categories: CentOS,Code Samples,Linux,Shell,System Administration
Tagged: command line, Linux, network, Security, system admin, traffic
- Published:
- May 6, 2009 – 11:10 pm
- Author:
- By Dave
I recently came across a typo that existed in a bunch of html files on my web server. I thought it should be easy enough to change, but since it was in a number of files, editing it by hand would be time consuming. Fortunately, there is an easy, one liner command to replace the text in multiple files in a sub directory using recursion. grep -lr -e ‘<oldword>’ * | xargs sed -i ‘s/<oldword>/<newword>/g’ This command broken down: grep for the word in a files, use recursion (to find files in sub directories), and list only file matches | xargs passes the results from the grep command to sed sed -i uses a regular expression (regex) to evaluate the change: s (search) / search word / target word / g (global replace) For more information, see man pages for grep, sed, and xarg. Also it is very handy to….
Categories: CentOS,Other Code,Shell,System Administration,Ubuntu
Tagged: command line, Linux, tips
- Published:
- May 3, 2009 – 11:12 pm
- Author:
- By Dave
Zabbix is an excellent system monitoring package. It does everything from basic availability checking to detailed system resource analysis. It is capable of graphing the variables pulled from the system, and alerting admins if there is a problem or something needed for attention. Once you have the Zabbix server set up, you need to install the client on any systems you want to monitor. Windows systems have a precompiled binary to install. On linux, unix or freebsd systems you’ll need to compile binaries. If you have a range of systems that are homogeneous, you can port the binary to those or also compile it with static dependencies. Below are steps to compile, configure and install the zabbix client: Steps to install a Zabbix Client Download zabbix source code from www.zabbix.com; decompress with ‘tar zxvf’ and cd to directory Configure the make program: ./configure –enable-agent Compile and install the program: make….
Categories: CentOS,Code Samples,Configurations,Linux,Programs,System Administration
Tagged: agent, alerts, monitoring, zabbix
- Published:
- March 23, 2009 – 9:14 am
- Author:
- By Dave
Recently I started seeing this error while provisioning Xen VPSes on a server with 8GB of RAM: 12[2009-03-23 15:51:40 xend.XendDomainInfo 3310] DEBUG (XendDomainInfo:1603) XendDomainInfo.destroy: domid=None [2009-03-23 15:51:40 xend 3310] ERROR (xmlrpclib2:184) (12, ‘Cannot allocate memory’) I checked the memory, and sure enough, all of the VPSes were using up the memory. More specifically, dom0 (the main server) had ‘ballooned’ and begun to take up 3GB of RAM, this is more than the system should need: 12[2009-03-22 18:03:08 xend.XendDomainInfo 3310] DEBUG (XendDomainInfo:1113) Setting memory target of domain Domain-0 (0) to 2903 MiB. [2009-03-22 18:03:09 xend 3310] DEBUG (balloon:127) Balloon: 537840 KiB free; need 537600; done. Basically when memory ballooning is set, the memory available to the main hypervisor will have a minimum value set and will balloon according to the current requirements. This setting is in the config file which for me is at /etc/xen/xend-config.sxp: 1234# Dom0 will balloon out when….
Categories: CentOS,Configurations,System Administration,Xen
Tagged: CentOS, dom0, memory, Xen