Category: How Tos

How To Articles

  • Protecting SSH from brute force attacks via iptables

    Put the following in /etc/sysconf/iptables and /etc/sysconf/ip6tables:

    -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name SSH
    -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 5 --rttl --name SSH -j DROP
    -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT

    restart iptables
    /bin/systemctl restart iptables.service
    /bin/systemctl restart ip6tables.service

  • Mango and Black Bean Quinoa Salad

    Quinoa Salad

    Here’s a salad my Wife found, it’s really good.

    Serves 4-6

    Ingredients:
    2 cpus of cooked qunioa, cooked in vegetable or chicken broth, at room temperature or chilled.
    1 (15-once) can black beans, drained and rinsed.
    1 medium mango, peeled and diced.
    1 red bell pepper, diced.
    4 green onions, white and green parts thinly sliced.
    1/2 cups chopped fresh cilantro.
    4 tablespoons red wine vinegar.
    3 tablespoons extra virgin olive oil.
    1-2 tablespoons fresh lime juice.
    1/2 teaspoon kosher salt.
    1/4 teaspoon black pepper.

    Directions:
    Plece the cooked quinoa in a large bowl. Add mango, red pepper, green onion, black beans, and cilantro.
    In a small bowl combine vinegar, olive oil, and lime juice. Whisk until the dressing is smooth and pour on top of the salad. Toss to combine and add salt and pepper (add more to taste if desired). Chill the salad for at least one hour before serving.

    Source: Mel’s Kitchen Cafe

  • Clearing cached memory on Linux system

    The Linux OS the tends keep Cached memory because the it decides that the Cached memory is being used and is needed which can lead to memory issues and slow do your system.

    To fix this problem you can force the system to free up the stored Cached memory.

    Create a script called /usr/local/bin/clearcache.sh with the following two lines:
    #!/bin/sh
    sync; echo 3 > /proc/sys/vm/drop_caches

    run “crontab -e” and add the following line:
    0 * * * * /usr/local/bin/clearcache.sh
    Also make the script executable by running “chmod +x /usr/local/bin/clearcache.sh”

    This should clear the Cached memory every hour.

  • Windows 7 as a Samba File Server for Linux machines

    If you get the this error message “mount error(12): Cannot allocate memory” while trying to mount a Windows SMB to a linux box.

    You need to configure Windows to act as a file server and it will allocate the resources needed.

    Change the registry key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerMemory ManagementLargeSystemCache  to ‘1′

    and Change HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesLanmanServerParametersSize  to ‘3′

    once you have done that do a reboot and try mounting the Samba drive again.

     

  • VMWare Workstation 8 Server

    Recently I have started using VMWare Workstation 8, this is really cool and seem to function better than VirtualBox.
    If you setup a virtual machine and set it to be shared, you can make it boot up with the Windows OS, hence this could be a headless sever hosting a Linux OS.
    You will need to log in as the Administrator to set permission to allow your own user account to use the shared VMware server. Once you have done that you can make any virtual machine boot up as a shared virtual machine without having to be logged in to Windows.

  • Drilling holes without much mess

    I learnt this from a friend.
    If you fold a post it note like a V or check mark sharp and stick it below where you want to drill a hole in the wall, it will catch all or most of the drywall or wood debris of where you are drilling a hole.
    This works best with the bigger PostIt Notes.

  • Fastest SD Card Reader

    I just got the IOGEAR SuperSpeed USB 3.0 SD/Micro SD Card Reader / Writer yesterday and it’s the fastest SD card reader i have ever seen. This was very cheap too, you can get it for around $15 from amazon.

    I was able to get 20MB/s write and 30MB/s read speed using a Patriot LX 16GB SD card on a USB 2.0 port on my MacBook, I properly could get a lot faster read speeds on a USB 3.0 port.

    Good work IOGEAR!

    You can read more about this product at http://www.iogear.com/product/GFR304SD/

     

    Update:

    I have tested this card reader on a windows 7 machine with a USB 3.0 port.

    I got 63MB/s read and 38MB/s write speed which is really cool.

  • Running a Ubuntu server on VirtualBox

    I created a virtual Ubuntu server on my Windows HTPC box using VirtualBox and VBoxVmService. This is a great setup as I can have a HTPC that’s always on with a Ubuntu server running on top.

    The Zbox is very energy efficient, quiet and small. This uses the AMD APU chip which is a all-in-one CPU/GPU combo.

    My setup is:

    • Zotac Zbox AD02
    • 8GB DDR3
    • 500GB WD HDD 7200k rpm
    • Windows 7 ultimate

    Installation was easy, I just installed VirtualBox, create a VM using the ISO from Ubuntu (make sure you install/enable SSH or NoMachine for remote access to the headless server), and then setup the VM to run as a service with VBoxVmService.

     

    http://vboxvmservice.sourceforge.net/

    https://www.virtualbox.org/

  • Nagios

    I Nagios is a wonderful tool to monitor your network devices.

     

    Nagios is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes.

    Designed with scalability and flexibility in mind, Nagios gives you the peace of mind that comes from knowing your organization’s business processes won’t be affected by unknown outages.

    Nagios is a powerful tool that provides you with instant awareness of your organization’s mission-critical IT infrastructure. Nagios allows you to detect and repair problems and mitigate future issues before they affect end-users and customers.

  • Latest Toastman Tomato Firmware

    The latest version of Toastman Tomato Firmware is really nice (i’m using 1.28.7500.4).

    You can now monitor IP Traffic by IP, so you can find out if you have a rouge device on your network that’s sucking up all your bandwidth or data usage.

    Also support for IPv6 is great.

    Thank you Toastman for keeping the firmware updated!

    http://www.4shared.com/dir/v1BuINP3/Toastman_Builds.html