Archives

All posts by Kelevra

I was about to buy a 3rd different USB wireless adapter and even considering a PCIe model with external antenna since I kept getting horrible performance with the nano adapters. I liked that they could just be plugged into the back of the system to add wireless support and they worked great on the Raspberry Pi, but on a desktop the performance was not much better than a dial-up connection.  Before ordering anther product someone mentioned interference and I then did a bit more digging and found Intel actually published a whitepaper on this subject (Linked at bottom).

After testing I was able to clearly see the effects of 2.4Ghz interference and would recommend to anyone having performance problems with wireless adapters to get a USB extension cable.  Using the same Plugable nano-N wireless adapter I ran a speed test from 3 locations:

Connected directly to back USB port

Connected directly to front USB Port

Connected to USB port via extension cable 3′ away

Intel’s Article: http://www.intel.com/content/www/us/en/io/universal-serial-bus/usb3-frequency-interference-paper.html

cornbread_500px2 Cups Washington Cornmeal (white self-rising)
1 Cup Self Rising flower
3 Eggs
½ Cup Sugar (little less)
Milk (as needed)
1 Stick of butter

Combine cornmeal, flower, sugar in large mixing bowl. Mix in eggs and enough milk to dry ingredients to make a thick batter. Whisk out large lumps but do not over-beat. Melt stick of butter in cast-iron pan on stove. Add batter to pan after butter has melted and bake at 400-425 until done. Cornbread should be brown and toothpick in center should come out dry when done. (Around 20 min)

I was planning to setup a Raspberry Pi to use my hosts file to filter out and block ads, but while digging around on the web found a project that had already done that along with added a web admin panel and statistics too.  Pi-hole is a quick and easy to install ab-blocking solution for the whole network.

Their site has a well laid out guide and their support is fast should you run into any issues. For the most part though it’s 1) get a Pi with Raspbian Lite 2) run curl -L https://install.pi-hole.net | bash on the Pi then 3) make a couple changes on router DNS server and restart systems to receive updated settings. Once up and running all devices connecting to your network will enjoy ad-blocking even if ad-block software is not or can’t be installed on them.

Mine has been running for number of months now without any issues and receives regular updates of ad sites to block. A quick look at the admin panel shows the current day’s statistics.
pi-hole_admin

paintbrush-150pxWhen working in modern word processors with multiple documents or sources it’s easy to end up with all sorts of different formats mixed together. The task of trying to manually format all the text in a document can be tedious and allows room for error. A simple solution is the Format Painter, which will copy the format of selected text to other areas of the document. Both LibreOffice and MS Office have this feature represented by a paintbrush icon in the tool bar.

To use the format painter highlight text with the format you want to paint other text with, then if only painting one selection of text click the format painter button or double click the format painter if painting multiple selections. The button will remain pressed and you can then highlight the text to be painted which will then have same format as the original selection.

Over time of downloading images from various sites I ended up with a bunch that had the wrong extensions. Either jpg that were really png and vice versa along with some ending in jpg-large.  This became more of a problem in that some viewers did not know how to open the images with incorrect file extensions.  After a few friends mentioned having similar issues I wrote a script to correct the extensions.  This script is written for BASH 4 or above and runs recursively on directories scanning all files to correct jpg and png extensions.

pic-fix

Download: pic-jpgpng-fix_v09

Checksums for pic-jpgpng-fix_v09.sh
MD5: 831afb9213ff9627683fd76c6c043b78
SHA256: e6f30bbbf93861632e56f2418278b141e80149db98c3c8eb023bb8df6f59aed9
Signed by my certificate with fingerprint: FBD2 A63D 0835 965D 0D94 1098 D54F 078F A777 5B9D

1 Box of rotini pastaPasta Salad
1 Large firm tomato
1 Large or 2 small cucumbers (English cucumbers with small seeds work better)
1 Bottle of Wishbone Robusto Italian Dressing
McCormic Salad Supreme Seasoning

It works best to start this the night before. Boil the pasta until done and rinse with cold water. Using a bowl with exta space to hold the pasta, Add 3/4 bottle of the Robusto Italian Dressing and about 2 to 3 tablespoons of Salad Suprem. Mix together and verify taste. The noodles should look seasoned; add a little more salad supreme if required. Store over night for pasta to absorb oils and flavor.

The next day, dice the tomato and pealed cucumber. Add the remaining Italian Dressing to the pasta and mix in the diced tomato and cucumber. Taste to ensure flavor and add a pinch of surgar if too tart.

Serve and enjoy.

My last post discussed updating the host file on Andriod. After doing a bit more tweaking I wrote a script which can be downloaded at the end of the article or created from the code below. The script will automatically download the latest hosts file from mvps.org and install it. It requires to be run as root and under the assumption that /sdcard exists as a storage location. Remember also to set the script permission to 700. The script can also be added to the crontab so you don’t have to worry about it again. (Next article will go over setting up crond and crontab on Android)

The Script:

#!/system/bin/sh

#Remount /system RW
mount -o remount,rw /system

#Make copy of current hosts file if backup does not exist
#Comment out this block if you have installed mvps.org hosts file before making backup
if [ ! -f /etc/.etchosts ]; then
cp /etc/hosts /etc/.etchosts
fi

#Check and create tmp dir if required
if [ ! -d /sdcard/tmp ]; then
mkdir /sdcard/tmp
fi

cd /sdcard/tmp
wget http://winhelp2002.mvps.org/hosts.txt
cat hosts.txt > /etc/hosts
rm hosts.txt

#If you need to add lines to host file
#make changes to /etc/.etchosts
#and uncomment next line to enable appending to hosts
#cat /etc/.etchosts >> /etc/hosts

#Remount /system RO
mount -o remount,ro /system

Download:

android_update_hosts.zip
sha256sum 95256b28deee2cbcd418f51ed6e358d42b7651bdbcc955521457dc370e5c537a android_update_hosts.sh

By now anyone using the internet is bombarded by ads everywhere online unless measures are taken to minimize them. There are plenty of ad blocking programs out there but another method that is easy is implement is the use of the hosts file. Originally this file was used to map hosts names to IP address before Domain Name Servers (DNS) was implemented in 1984 allowed for the process to be automated. For most end users today this file is unused but could provide beneficial experiences if configured. When an IP address is specified in the hosts file for a domain the system will use that address, allowing blocking of sites by directing them to 0.0.0.0 or 127.0.0.1. This can be used to stop ads from loading and potentially increase page load times. Now it might seem like a tedious task to add all the add sites to block but there are providers of hosts files that are already completed and updated regularly; I use MVPs.org to provide my hosts files.

Note that while the hosts file when configured can block ads and some malware redirects, it is only an additional layer of protection. Systems should still run other forms of protection such as anti-virus and anti-malware with the hosts file. Below are instructions to load the file from MVPs.org to the most common operating systems.

Windows:

The hosts file in modern distributions is located at %SystemRoot%\system32\drivers\etc\hosts and can be edited with notepad or other text editors. Just be sure not not add any extension like .txt which the built in notepad is known for doing. Note that the file is in the windows directory so any app trying to edit it will require being run as administrator.

Thankfully however, MVPs.org has an app to update the host file easily. Just download the zip file from http://winhelp2002.mvps.org/hosts.htm and unzip to a folder. Then right-click the mvps batch file and choose Run as administrator. This will load the downloaded data into the host file. More detailed instructions and the date of last updated host file is available on their site.

Linux:

While I was manually updating host files before, came across a post to make a script for Linux which when added to the chrontab allows for easily maintaining the most up to date hosts file. Visit http://www.putorius.net/2012/01/block-unwanted-advertisements-on.html for details and description of the script. I made a few small changes.

To complete these steps you will need to be running as root or using sudo su to get root permission. Your prompt should end with #

First, backup your current host file:
cp /etc/hosts /etc/.etchosts

Next use vi or nano to create the script /root/update_hosts.sh and add the following code to it:
#!/bin/bash
cd /tmp
wget http://winhelp2002.mvps.org/hosts.txt
rm /etc/hosts
mv hosts.txt /etc/hosts
cat /etc/.etchosts >> /etc/hosts

Make the file executable by running:
chmod +x /root/update_hosts.sh

Schedule to run automatically:
run crontab -e then add the line below to make it update nightly at 23:59
59 23 * * * /root/update_hosts.sh > /dev/null 2>&1
The time can be changed by adjusting the numbers. the > /dev/null 2>&1 is sending all output from the scheduled job to the bit bucket so that crontab does not email the results each night.

Mac:

Instructions for updating the Mac OS host file can be found here: http://pointhope.de/tips&tricks/no_place_like_localhost.html

Android:

If you have root on your Android device the hosts file is stored at /system/etc/hosts and can be changed with a terminal app, however you will need to mount the path as R/W before changes can be made. Something like Beansoft – Mount /system (rw / ro) will do the job. Because on Android the hosts file is symbolic linked to /etc/hosts as well it seems to not want to allow overwriting the file but the contents can be changed with the cat command and achieve the same desired result.

Remember to run su as commands require root access.

First time  backup your current hosts file:
cp /system/etc/hosts /system/etc/.etchosts

Then run the following to update:
cd /sdcard/tmp
If you do not have a /sdcard/tmp directory run mkdir /sdcard/tmp and rerun the cd command above
wget http://winhelp2002.mvps.org/hosts.txt
cat hosts.txt > /system/etc/hosts
cat /system/etc/.etchosts >> /system/etc/hosts
rm hosts.txt

At this point you can exit terminal and then remount System as R/O.

Wow, the amount of spam comments on WordPress is pretty amazing (not).  I thought by changing settings to “Users must be registered and logged in to comment” would fix things but apparently not… Even with “Allow link notifications from other blogs (pingbacks and trackbacks)” unchecked was still some how getting spammed like crazy (little did I know at the time that unchecking that option only affected new posts).

Getting hundreds of spam messages a day is enough to drive anyone nuts so I had to find a solution.  Now being that most the spam was being generated on one post, I probably could have just disabled comments on that one post but that would have only been a short term fix.  Also at the time I couldn’t find the option to disable comments on a single post… who thought it was a great idea to hide that option under screen options of the post?

WP Screen Options

Now however I have activated Akismet through JetPack and will see how it does on managing to filter all the spam. It’s got over 100 in spam already and none pending approval so that seems to be doing well.  Now I can focus on more important things other than filtering spam.

Deviled Eggs

Ingredients:

  • Eggs
  • Salt & Pepper
  • Miracle Whip
  • Yellow Mustard
  • Apple Cider Vinegar
  • Paprika

Fill pot with cold water, a dozen or so eggs and add a bit of salt. Using medium heat bring to hard boil for 10-15 minutes. Drain and rinse to cool eggs, do not leave eggs soaking in water. Peel egg shells, and slice eggs in half. Separate yokes into a bowl and place the egg halves on a paper towel to cool and dry before filling.

Mash the yokes into a semi-fine powder, be sure to get the big lumps out now. Add a couple tablespoons of Miracle Whip, dash of salt and pepper, splash of vinegar and yellow mustard. Mix together until creamy and add Miracle Whip as required to adjust consistency. Taste and adjust other ingredients as required.

Fill the egg halves with the yoke mixture and place onto serving dish. Garnish with paprika.