<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Linux on sigtar.com</title>
		<link>https://sigtar.com/tags/linux/</link>
		<description>Recent content in Linux on sigtar.com</description>
		<generator>Hugo</generator>
		<language>en-nz</language>
		
		
		
		
			<lastBuildDate>Thu, 10 Sep 2020 00:00:00 +1200</lastBuildDate>
		
			<atom:link href="https://sigtar.com/tags/linux/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>emergency reboot a hung Linux host</title>
				<link>https://sigtar.com/2020/09/10/emergency-reboot-a-hung-linux-host/</link>
				<pubDate>Thu, 10 Sep 2020 00:00:00 +1200</pubDate>
				<guid>https://sigtar.com/2020/09/10/emergency-reboot-a-hung-linux-host/</guid>
				<description>&lt;p&gt;&lt;img src=&#34;https://sigtar.com/wp-content/uploads/Screenshot-Terminal.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Sometimes you need something that can kick a host a bit harder than the standard &lt;strong&gt;reboot&lt;/strong&gt; command. Even if you include the &lt;strong&gt;-f&lt;/strong&gt; switch to force, a hung task can prevent your host from rebooting.&lt;/p&gt;&#xA;&lt;p&gt;Try this - first enable the sysrq setting, then trigger. Your host should reboot immediately.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;sudo echo 1 &amp;gt; /proc/sys/kernel/sysrq&lt;/strong&gt;&lt;br&gt;&#xA;&lt;strong&gt;sudo echo b &amp;gt; /proc/sysrq-trigger&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note : This is effectively a hard reset which does not cleanly shut services or tasks down. You may need to check your disk on some operating systems.&lt;/p&gt;</description>
			</item>
			<item>
				<title>nginx - setup as reverse proxy</title>
				<link>https://sigtar.com/2014/02/08/nginx-setup-as-reverse-proxy/</link>
				<pubDate>Sat, 08 Feb 2014 00:00:00 +1300</pubDate>
				<guid>https://sigtar.com/2014/02/08/nginx-setup-as-reverse-proxy/</guid>
				<description>&lt;p&gt;Previously to take down this wordpress site all you needed to do was hold down F5 for about 20 seconds then the site would take about 5 mins to recover.&lt;/p&gt;&#xA;&lt;p&gt;There were a few factors causing this and quite a few different methods to solving the problem. Wordpress itself is run on php / apache, apache has an evasive mod which can block certain IPs depending on the defined abusive behavior (typical DDOS attack). Since i like to run a few websites behind a single IP i looked at fixing the issue closer to the perimeter&amp;hellip;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>use nmap to port scan / find free IPS</title>
				<link>https://sigtar.com/2013/07/12/use-nmap-to-port-scan-find-free-ips/</link>
				<pubDate>Fri, 12 Jul 2013 00:00:00 +1200</pubDate>
				<guid>https://sigtar.com/2013/07/12/use-nmap-to-port-scan-find-free-ips/</guid>
				<description>&lt;p&gt;I use angry IP scanner in windows, linux has a good util for port scanning an ip range called nmap;&lt;/p&gt;&#xA;&lt;p&gt;Grab nmap from usual repositories&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;sudo nmap -sP 192.168.9.0/24&lt;/strong&gt; (will show hosts up and resolve mac addresses to vendors)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;sudo nmap -v -sT 192.168.9.0/24&lt;/strong&gt; (will show hosts up and the various open ports)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;sudo nmap -v -sT 192.168.9.104&lt;/strong&gt; (will show particular host and the various open ports)&lt;/p&gt;&#xA;&lt;p&gt;Starting Nmap 6.00 ( &lt;a href=&#34;http://nmap.org&#34;&gt;http://nmap.org&lt;/a&gt; ) at 2013-07-12 11:48 NZST Initiating ARP Ping Scan at 11:48 Scanning 192.168.9.104 [1 port] Completed ARP Ping Scan at 11:48, 0.00s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 11:48 Completed Parallel DNS resolution of 1 host. at 11:48, 0.00s elapsed Initiating Connect Scan at 11:48 Scanning win2012-veeam.fritz.box (192.168.9.104) [1000 ports] Discovered open port 111/tcp on 192.168.9.104 Discovered open port 445/tcp on 192.168.9.104 Discovered open port 3389/tcp on 192.168.9.104 Discovered open port 135/tcp on 192.168.9.104 Discovered open port 139/tcp on 192.168.9.104 Discovered open port 49155/tcp on 192.168.9.104 Discovered open port 1063/tcp on 192.168.9.104 Discovered open port 2049/tcp on 192.168.9.104 Discovered open port 3260/tcp on 192.168.9.104 Completed Connect Scan at 11:48, 4.21s elapsed (1000 total ports) Nmap scan report for win2012-veeam.fritz.box (192.168.9.104) Host is up (0.00059s latency). Not shown: 991 filtered ports PORT STATE SERVICE 111/tcp open rpcbind 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds 1063/tcp open kyoceranetdev 2049/tcp open nfs 3260/tcp open iscsi 3389/tcp open ms-wbt-server 49155/tcp open unknown MAC Address: 00:50:56:9C:68:FA (VMware)&lt;/p&gt;</description>
			</item>
			<item>
				<title>cron job to re prioitize tasks</title>
				<link>https://sigtar.com/2012/10/16/cron-job-to-re-prioitize-tasks/</link>
				<pubDate>Tue, 16 Oct 2012 00:00:00 +1300</pubDate>
				<guid>https://sigtar.com/2012/10/16/cron-job-to-re-prioitize-tasks/</guid>
				<description>&lt;p&gt;I&amp;rsquo;m using the following crontab script to renice my squid process&amp;hellip;.&lt;/p&gt;&#xA;&lt;p&gt;Put following in script and  call via cron (i&amp;rsquo;m doing every 10 mins)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;*/10 * * * * /home/user/renice.sh&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;(renice.sh)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;renice -15 $(ps -C squid3 -o pid=)&lt;/strong&gt; &lt;strong&gt;renice -15 $(ps -C unlinkd -o pid=)&lt;/strong&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Linux - install vmware tools onto guest</title>
				<link>https://sigtar.com/2010/09/05/linux-install-vmware-tools-onto-guest/</link>
				<pubDate>Sun, 05 Sep 2010 00:00:00 +1200</pubDate>
				<guid>https://sigtar.com/2010/09/05/linux-install-vmware-tools-onto-guest/</guid>
				<description>&lt;p&gt;fire up the vm, then run the following after initiating a vmware tools install&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;mount /dev/cdrom /mnt/cdrom cd /tmp tar zxf /mnt/cdrom/VMwareTools-x.x.x.gz cd vmware-tools-disstrib ./vmware-install.pl&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then just follow the prompts through to the end.&lt;/p&gt;&#xA;&lt;p&gt;If your running fedora or similar make sure your&amp;rsquo;ve got gcc and kernel headers&amp;hellip;. (you&amp;rsquo;ll probably have to update kernel too)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;yum update shutdown -r now yum install -y gcc make kernel-devel perl&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Ubuntu 12.x&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;apt-get install open-vm-tools&lt;/strong&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>VirtualBox - crashing / freezing</title>
				<link>https://sigtar.com/2009/09/05/virtualbox-crashing-freezing/</link>
				<pubDate>Sat, 05 Sep 2009 00:00:00 +1200</pubDate>
				<guid>https://sigtar.com/2009/09/05/virtualbox-crashing-freezing/</guid>
				<description>&lt;p&gt;I&amp;rsquo;ve had some problems since my upgrade to virtualbox 2.2.0 on OpenSolaris. After some time all of my linux boxes seem to just die. The virtual machine just stops responding. Strangely there was no problem with my windows vms after the update.&lt;/p&gt;&#xA;&lt;p&gt;From what i can tell it looks like the upgrade turned off &amp;ldquo;&lt;strong&gt;IO APIC&lt;/strong&gt;&amp;rdquo; - this is the bit that seemed to cause the problem. Re-enabling this on all of my linux boxes seems to have fixed the problem. I&amp;rsquo;ll continue testing for another week and update this post if any problems re-occur.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Linux - Add DHCP and DNS</title>
				<link>https://sigtar.com/2009/02/11/linux-add-dhcp-and-dns/</link>
				<pubDate>Wed, 11 Feb 2009 00:00:00 +1300</pubDate>
				<guid>https://sigtar.com/2009/02/11/linux-add-dhcp-and-dns/</guid>
				<description>&lt;p&gt;How to install DHCP and DNS on Fedora / Centos / Redhat box;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;yum -y install dhcp.i386 bind.i386&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Set services to auto start using &lt;strong&gt;ntsysv&lt;/strong&gt; &amp;ndash; services are called &amp;ldquo;dhcpd&amp;rdquo; and &amp;ldquo;named&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;How to configure dhcp;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;nano /etc/dhcpd.conf&lt;/strong&gt; &amp;mdash; configure as per sample provided. The sample is usually located in the same directory. &lt;strong&gt;service dhcpd restart&lt;/strong&gt; - should start without problem if done correctly&lt;/p&gt;&#xA;&lt;p&gt;Note: dhcp range has to be on the same network as your adapter. You can run dhcpd from the command line to diagnose any issues.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Linux - Installing VirtualBox additions</title>
				<link>https://sigtar.com/2009/02/04/linux-installing-virtualbox-additions/</link>
				<pubDate>Wed, 04 Feb 2009 00:00:00 +1300</pubDate>
				<guid>https://sigtar.com/2009/02/04/linux-installing-virtualbox-additions/</guid>
				<description>&lt;p&gt;The following works on CentOs / Fedora / redhat etc&amp;hellip; &lt;/p&gt;&#xA;&lt;p&gt;Logon to your distro. The packages you need are the &lt;strong&gt;kernel-devel.i686&lt;/strong&gt;, &lt;strong&gt;kernel.i686&lt;/strong&gt; (if not the latest), and &lt;strong&gt;gcc.i386&lt;/strong&gt; (complier)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;yum -y install kernel.i686 gcc.i386&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;reboot as the kernel needs to load, then logon again install the kernel dev; &lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;yum -y install kernel-devel.i686&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now you want to present the virtualbox additions to the cdrom drive on your distro. Click &amp;ldquo;install additions&amp;rdquo; on the virtualbox guest console. &lt;/p&gt;</description>
			</item>
			<item>
				<title>Linux - crontab</title>
				<link>https://sigtar.com/2009/02/03/linux-crontab/</link>
				<pubDate>Tue, 03 Feb 2009 00:00:00 +1300</pubDate>
				<guid>https://sigtar.com/2009/02/03/linux-crontab/</guid>
				<description>&lt;p&gt;Time to schedule some tasks!&lt;/p&gt;&#xA;&lt;p&gt;First you need to make sure your in the &lt;strong&gt;/etc/cron.d/cron.allow&lt;/strong&gt; file. If you are not &lt;strong&gt;SU&lt;/strong&gt; to root and add yourself into it.&lt;/p&gt;&#xA;&lt;p&gt;Now to create your new crontab file;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;crontab -e&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;You are in &lt;strong&gt;vi&lt;/strong&gt; in your newly created crontab file (note if you do not have access to do this it will say so)&lt;/p&gt;&#xA;&lt;p&gt;Now, i&amp;rsquo;m no expert at using &lt;strong&gt;vi&lt;/strong&gt;, but if you press &lt;strong&gt;i&lt;/strong&gt; you will go into insert mode. Do this, then type the cron job details. A typical cron job will look like this&lt;/p&gt;</description>
			</item>
			<item>
				<title>Linux - Hard Drive Performance</title>
				<link>https://sigtar.com/2009/02/03/linux-hard-drive-performance/</link>
				<pubDate>Tue, 03 Feb 2009 00:00:00 +1300</pubDate>
				<guid>https://sigtar.com/2009/02/03/linux-hard-drive-performance/</guid>
				<description>&lt;p&gt;Or lack of.&lt;/p&gt;&#xA;&lt;p&gt;You must insure that your drives are using the sata driver (if they are sata disks), quickest way to check is that they will be called sda sdb etc&amp;hellip;. and not hda hdb, as this is the default IDE driver and will slow down the performance majorly.&lt;/p&gt;&#xA;&lt;p&gt;How to check performance;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;hdparm -tT /dev/hda&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Modern drives should be getting over 50MB/s easily. If your getting about 5MB/s you have the problem.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Linux - setting the time</title>
				<link>https://sigtar.com/2009/02/03/linux-setting-the-time/</link>
				<pubDate>Tue, 03 Feb 2009 00:00:00 +1300</pubDate>
				<guid>https://sigtar.com/2009/02/03/linux-setting-the-time/</guid>
				<description>&lt;p&gt;How to set the time in Linux; (from a command line)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;date -s &amp;ldquo;09/21/2007 09:20:00&amp;rdquo;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;hwclock &amp;ndash;systohc&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;the second command links the time back to the hardware clock.&lt;/p&gt;&#xA;&lt;p&gt;Note: within a vm guest it is always advised to install the guest additions as the time on a guest can slowly move away from the correct time.&lt;/p&gt;</description>
			</item>
			<item>
				<title>VMWare Performance tips</title>
				<link>https://sigtar.com/2009/02/02/vmware-performance-tips/</link>
				<pubDate>Mon, 02 Feb 2009 00:00:00 +1300</pubDate>
				<guid>https://sigtar.com/2009/02/02/vmware-performance-tips/</guid>
				<description>&lt;p&gt;these are tested from experience&amp;hellip;. (the following is true on vmware server 1.0.6 on a linux host)&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Always use only 1 Virtual CPU - i have found that most times even if you have heaps of cores to spare on the host, a single virtual core is faster.&lt;/li&gt;&#xA;&lt;li&gt;Set the memory to the recommended level when possible - 256Mb sounds shit when you have 4gb, doesn&amp;rsquo;t matter - set it to 256Mb (increase only if excessive paging on the guest). Let linux and vmware manage the memory, in most cases it does a much better job than windows. Do not disable memory page trimming on any of the guests, this gives more memory back to the host to cache other more important activity (disk etc)&lt;/li&gt;&#xA;&lt;li&gt;Never use 2gb split files for the virtual disk unless you have to transfer the vm onto a file system that doesn&amp;rsquo;t support larger files.&lt;/li&gt;&#xA;&lt;li&gt;Load the latest drivers for your NIC on the host&lt;/li&gt;&#xA;&lt;li&gt;Be nice to your physical disk - do not load all your VM&amp;rsquo;s on a single drive - the HDD is the slowest part of the system, dont saturate it. I use either a raid 0 running multiple vm&amp;rsquo;s (with backups) or dedicated drives per set of vm&amp;rsquo;s. This excludes enterprise level raids which can handle much higher level of simultaneous requests.&lt;/li&gt;&#xA;&lt;li&gt;Install vmware tools on all guest machines&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;watch your pings - ping your guests&amp;hellip; they should never loose a ping. If they do you are loading the cpu to high and the host cannot process the network queries. As above use only one virtual cpu. Also ensure you have the latest network driver loaded for your NIC on the host.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
