Article RSS Feed http://www.snippety.org/rss/ en-us 40 The main blog feed for www.snippety.org. Internet: How to test a POP server by using telnet <p>What you need</p> <pre><code>The host name of the POP server (for use in the telnet command) The POP user name (for use in the USER command) The user’s POP password (for use in the PASS command)</code></pre> <p>Encryption</p> <p>For added security, you can encrypt your <span class="caps">POP</span> connection. This requires that your server supports <span class="caps">SSL</span> or <span class="caps">TLS</span> and that you have access to an <span class="caps">SSL</span>/TLS client program, for example OpenSSL, to use instead of telnet.</p> <p>As the port number normally is 995, an example OpenSSL command would be openssl s_client -connect pop.example.com:995 -quiet.</p> <p>Read to full article <a href="http://www.anta.net/misc/telnet-troubleshooting/pop.shtml">here</a></p> Thu, 05 Jan 2012 10:55:49 GMT http://www.snippety.org/articles/2012/01/05/internet-how-to-test-a-pop-server-by-using-telnet/ http://www.snippety.org/articles/2012/01/05/internet-how-to-test-a-pop-server-by-using-telnet/ Create FreeBSD jail without compiling userland. <p>I found an website explaining installing FreeBSD jails without compiling userland (make buildworld) first, altough the steps where clear and complete I screwed up my FreeBSD installation because of a minor typo (entering parameters in all lowecase instead of camel case). Then I decided to write a script avoiding this to happen in the future.</p> <p>I you find this useful as well, you can find this script in my <a href="https://bitbucket.org/provonet/buildjail">bitbucket repository</a></p> Sat, 07 May 2011 15:04:02 GMT http://www.snippety.org/articles/2011/05/07/create-freebsd-jail-without-compiling-userland-/ http://www.snippety.org/articles/2011/05/07/create-freebsd-jail-without-compiling-userland-/ Handy tcsh aliases for use with chef knife shell <p>Here are some handy tcsh aliases for the knife shell utility of the opscode chef infrastructure automation solution:</p> <code>alias knifeshell knife ssh "\!:1" interactive -a hostname -x YourUserName</code> <p>This will connect to all servers matching a search query so:</p> <code>knifeshell "hostname:a*"</code> will connect to all servers with a hostname starting with the letter &#8220;a&#8221; <code>knifescreen knife ssh "\!:1" screen -a hostname -x -x YourUserName</code> <p>This will do more or less the same as the previous command but it will use the gnu screen utility</p> <p>and finaly:</p> <code>alias kniferun knife ssh "\!:1" "\!:2" -a hostname -x YourUserName</code> <p>will run a shell command on all servers matching the search query.</p> <p>example:</p> <p>to show the directory listing of your home folders for all servers known by chef:</p> <code>kniferun "hostname:[* TO *]" ls</code> <p>for more information about the search syntax or the knife utility check the opscode <a href="http://wiki.opscode.com/display/chef/Home">wiki</a></p> Wed, 06 Apr 2011 10:11:23 GMT http://www.snippety.org/articles/2011/04/06/handy-tcsh-aliases-for-use-with-chef-knife-shell/ http://www.snippety.org/articles/2011/04/06/handy-tcsh-aliases-for-use-with-chef-knife-shell/ Fix plymouth boot splash on Ubuntu 10.10 (Maverick Meerkat) <p>To get rid of the ugly plymouth boot splash screen after installing <span class="caps">ATI</span> or <span class="caps">NVIDIA</span> drivers do the following:</p> <ol> <li>Install v86d package (<code>sudo apt-get install v86d</code>)</li> <li>Edit the grub config file (<code>/etc/default/grub</code>) <ul> <li>replace <span class="caps">GRUB</span>_CMDLINE_LINUX_DEFAULT=&#8221;quiet splash&#8221; into <code>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1280x800-24,mtrr=3,scroll=ywrap"</code> or whatever resolution you want to use.</li> <li>replace #GRUB_GFXMODE=640&#215;480 into <code>GRUB_GFXMODE=1280x800</code> (or whatever resolution you used in the previous change).</li> </ul> </li> <li>Edit the initramfs config file (<code>/etc/initramfs-tools/modules</code>) <ul> <li>add the following line to the the config file <code>uvesafb mode_option=1280x1024-24 mtrr=3 scroll=ywrap</code></li> </ul> </li> <li>Enable framebuffer support <ul> <li>add <code>FRAMEBUFFER=y</code> to <code>/etc/initramfs-tools/conf.d/splash</code> (<code>echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash</code>)</li> </ul> </li> <li>Update grub and initramfs <ul> <li><code>sudo update-grub2 &#38;&#38; sudo update-initramfs -u</code></li> </ul> </li> <li>Reboot</li> </ol> Mon, 11 Oct 2010 14:51:19 GMT http://www.snippety.org/articles/2010/10/11/fix-plymouth-boot-splash-on-ubuntu-10-10-maverick-meerkat/ http://www.snippety.org/articles/2010/10/11/fix-plymouth-boot-splash-on-ubuntu-10-10-maverick-meerkat/ Error on this site <p>Hi,</p> <p>If you came across this website in the last months or so you probably noted the undefined method `[]&#8217; for #, error message on several pages including the homepage. Today I finally took some time to fix this issue.</p> Tue, 21 Sep 2010 20:55:11 GMT http://www.snippety.org/articles/2010/09/21/error-on-this-site/ http://www.snippety.org/articles/2010/09/21/error-on-this-site/ Installing Passenger Nginx module on FreeBSD Currently (at least when I wrote this article) the FreeBSD ports system didn't contain a port for the Passenger Nginx module to deploy a Ruby on Rails application in the Nginx webserver, but it did contain all the necessary components. It is rather simple the use the nginx and rubygem-passenger from the port system and enable passenger support in Nginx. Sat, 16 May 2009 13:07:23 GMT http://www.snippety.org/articles/2009/05/16/installing-passenger-nginx-module-on-freebsd/ http://www.snippety.org/articles/2009/05/16/installing-passenger-nginx-module-on-freebsd/ Ubuntu Performance Tuning <p>The overall performance of Ubuntu Linux is fine but to further tune the following can be done :</p> <p>1. If you are not using IPv6 it can be disabled as follows:</p> <p>In <strong>/etc/modprobe.d/aliases</strong> change the line <strong>alias net-pf-10 ipv6</strong> into <strong>alias net-pf-10 off #ipv6</strong>.</p> <p>2. Start daemon/processes in parallel</p> <p>Change /etc/init.d/rc from <strong><span class="caps">CONCURRENCY</span>=none</strong> in <strong><span class="caps">CONCURRENCY</span>=shell</strong></p> <p>3. Add your hostname in the host file (default on hardy &#38; intrepid). If you add your host name to the <strong>/etc/hosts</strong> file some apps will start quicker. e.g. <strong>127.0.1.1 myhostname</strong></p> <p>4. Install <strong>preload</strong>. Startup times on apps. can be further improved by installing <strong>preload</strong> (apt-get install preload)</p> <p>5. Decrease Swappiness setting</p> <p>If you got plenty of ram (&gt;1GB) you can decrease the use of the swap file by changing the vm.swappiness sysctl entry from 60 to <strong>10</strong>. If you like to further reduce swapfile usage you can set this value to <strong>0* which will not disable swapfile usage but will reduce it to the absolute minimum. To change the sysctl entry *sysctl vm.swappiness=10</strong> can be used, to let this setting survive a reboot <strong>vm.swapiness=10</strong> can be added to the <strong>/etc/sysctl.conf</strong> file.</p> <p>I’ve found that the value of 5 works very good for my use and I have 2 GB of memory.</p> <p>6. Use the profile option of grub to reduce startup time.</p> <p>Hit the escape button when booting to get to the grub menu, select the default kernel and select edit, add the profile option to the end of the kernel line and boot your system.</p> <p>8. Disable unused services.</p> <p>9. Use the noatime mount option to disable updating the access time on files.</p> <p>If you have additional tips I&#8217;m more then willing to test/add them to this list.</p> Tue, 23 Sep 2008 13:06:18 GMT http://www.snippety.org/articles/2008/09/23/ubuntu-performance-tuning/ http://www.snippety.org/articles/2008/09/23/ubuntu-performance-tuning/ Internet: Javascript Techniques <p>Developers and designers are using more and more JavaScript in modern designs. Sometimes this can be a hindrance to the user and take away from the simplicity of the design, and other times it can add greatly to the user’s experience. The key is a) adding the right amount of JavaScript, and b) using the right JavaScript techniques.</p> <p>More: <a href="http://www.smashingmagazine.com/2008/09/11/75-really-useful-javascript-techniques/">continued here</a></p> Fri, 12 Sep 2008 14:02:12 GMT http://www.snippety.org/articles/2008/09/12/internet-javascript-techniques/ http://www.snippety.org/articles/2008/09/12/internet-javascript-techniques/ Programming: Regular Expressions tips and tricks <p>I knew it from the first glance, that regular expressions were very very beautiful. As of today, I feel that I have a pretty good grasp of regular expressions.</p> <p>More: <a href="http://www.blackhat-seo.com/2007/regex-tips-and-tricks/">continued here</a></p> Wed, 10 Sep 2008 06:26:46 GMT http://www.snippety.org/articles/2008/09/10/programming-regular-expressions-tips-and-tricks/ http://www.snippety.org/articles/2008/09/10/programming-regular-expressions-tips-and-tricks/ Internet: Tuning Apache for Maximum Performance <p>Apache is an open-source <span class="caps">HTTP</span> server implementation. It is the most popular web server on the Internet; the December 2005 Web Server Survey conducted by Netcraft [1] shows that about 70% of the web sites on Internet are using Apache.</p> <p>Apache server performance can be improved by adding additional hardware resources such as <span class="caps">RAM</span>, faster <span class="caps">CPU</span>, etc. But most of the time, the same result can be achieved by custom configuration of the server. This article looks into getting maximum performance out of Apache with the existing hardware resources, specifically on Linux systems. Of course, it is assumed that there is enough hardware resources &#8211; especially enough <span class="caps">RAM</span> that the server isn&#8217;t swapping frequently. First two sections look into various Compile-Time and Run-Time configuration options. The Run-Time section assumes that Apache is compiled with prefork [1] <span class="caps">MPM</span>. HTTP compression and caching is discussed next. Finally, using separate servers for serving static and dynamic contents is covered. Basic knowledge of compiling and configuring Apache and Linux are assumed.</p> Mon, 03 Mar 2008 11:12:24 GMT http://www.snippety.org/articles/2008/03/03/internet-tuning-apache-for-maximum-performance/ http://www.snippety.org/articles/2008/03/03/internet-tuning-apache-for-maximum-performance/ Headless Compaq desktop (boot without a keyboard attached) <p>Searching for the old Compaq nof1.exe utility (A utility to change a Compaq Desktop to boot without a keyboard attached) I came across the following tip:</p> <p><em>1. Set a power on password (under security in the <span class="caps">BIOS</span> settings)</em> <em>2. Go back into security menu and select the new item that appears just below power on password, it&#8217;s called password settings or suchlike.</em> <em>3. Enable Network server mode</em></p> <p><em>Your machine will now boot happily without a keyboard, and in case you wonder also without asking for the password you just set.</em></p> <p><em>The keyboard, if anyone does plug one in, is disabled except during power up when you can still press <span class="caps">F10</span> for setup. Doing so will then lead to a prompt for the password.</em></p> <p>I tried the above tip and it works perfectly, for correctness: the &#8220;password settings&#8221; option in the <span class="caps">BIOS</span> is called <strong>password options</strong> instead of &#8220;password settings&#8221;.</p> Mon, 14 Jan 2008 19:24:48 GMT http://www.snippety.org/articles/2008/01/14/headless-compaq-desktop-boot-without-a-keyboard-attached/ http://www.snippety.org/articles/2008/01/14/headless-compaq-desktop-boot-without-a-keyboard-attached/ Install FreeBSD 7.0 on a ZFS partition <p><span class="caps">ZFS</span> is an exciting new file system developed by Sun and recently ported to FreeBSD. Many people are excited by the possibilities of <span class="caps">ZFS</span> (including us) as it promises to simplify a great many things. It offers:</p> <ul> <li>increased reliability through checksums, multiple copies of data and self-healing <span class="caps">RAID</span></li> <li>elimination of that dreaded “oh, if only I’d made the /var partition larger” feeling. Partitions can now be resized at any time and in fact can each be allocated up to the full size of the storage media.</li> <li>built-in compression and encryption</li> <li>built-in <span class="caps">NFS</span> file sharing</li> <li>clean, easy to use toolset for creating storage pools, volumes and much more</li> <li>snapshots and rollbacks for backups</li> </ul> Tue, 01 Jan 2008 11:24:17 GMT http://www.snippety.org/articles/2008/01/01/install-freebsd-7-0-on-a-zfs-partition/ http://www.snippety.org/articles/2008/01/01/install-freebsd-7-0-on-a-zfs-partition/ Rotating Rails Log Files <p>taken from: <a href="http://www.nullislove.com/">NullIsLove</a></p> <p>One of the chores I dislike most is cleaning up and clearing out the log files in my Rails applications. On some of my higher profile sites, I get a lot of spiders probing my applications for security holes. They don’t succeed (knock on wood) but they do fill up my log files with errors.</p> <p>I finally decided to get smart and get lazy (the two best traits a programmer can have), and I set up automatic log rotation on all of my Rails applications. The idea behind log rotation is simple: make a back up of the current log file, continue logging into a new or cleared log file, and discard log files that are older than a certain date.</p> <p>Your webserver probably already rotates its own log files. For Apache, they are probably located in /etc/httpd/logs and they are probably rotated weekly. These logs store everything Apache does. Simple webserver stats and traffic analysis tools make use of these log files to show who visits a site when and what pages are viewed.</p> <p>While it is possible to configure your Rails application to log to your Apache log files, I do not think it is a good practice. It’s much better to give each Rails application its own log file—it will be easier to find important Rails errors, it will keep your Apache logs cleaner and Rails is set up to keep its own logs by default. Fortunately, on a Linux server the built-in logrotate program will make the process super-easy. After the jump, I’ll walk you through the steps to get it set up.</p> Wed, 28 Nov 2007 19:39:20 GMT http://www.snippety.org/articles/2007/11/28/rotating-rails-log-files/ http://www.snippety.org/articles/2007/11/28/rotating-rails-log-files/ Network cloning a FreeBSD system <p>On this <a href="http://tomclegg.net">website</a> I found the following tip:</p> <p><strong>Cloning a FreeBSD system</strong></p> <p>Simplifying by assuming a single partition, a secure network, and ucspi-tcp already installed on <span class="caps">ORIG</span>&#8230;</p> <p>Install fresh hard disk in <span class="caps">CLONE</span>, and boot from a FreeBSD rescue floppy.</p> <p>Rather than installing, go to the &#8220;configure&#8221; submenu and do &#8220;fdisk&#8221; and &#8220;slice.&#8221; Use <span class="caps">W Q</span> instead of just Q to quit each one. Install a boot manager just as if you were building a new system.</p> <p>Go back to the main menu and choose &#8220;fixit,&#8221; then &#8220;live filesystem on CD-ROM.&#8221;</p> Wed, 28 Nov 2007 16:06:59 GMT http://www.snippety.org/articles/2007/11/28/network-cloning-a-freebsd-system/ http://www.snippety.org/articles/2007/11/28/network-cloning-a-freebsd-system/ Internet: IPV6 and Thomson Speedtouch 500 series <p>In order to get a <span class="caps">IPV6</span> tunnel working with a Thomson Speedtouch 500 series <span class="caps">ADSL</span> modem like the Speedtouch 510. You will have to set the following option in your modem:</p> <p>(connect via telnet)</p> <code>=&gt; nat unbind application IP6TO4 port=1[ENTER]</code><br /> <p>Other IPv6 tunneling tips can be found on <a href="http://tunnel-broker.singnet.com.sg/faq.html">this</a> website.</p> Fri, 28 Sep 2007 18:16:27 GMT http://www.snippety.org/articles/2007/09/28/internet-ipv6-and-thomson-speedtouch-500-series/ http://www.snippety.org/articles/2007/09/28/internet-ipv6-and-thomson-speedtouch-500-series/