Topic: Tutorials

Ad placement in the modern world

You know why ads on the Spotify desktop client alternate between a vertical bar on the right and a horizontal banner on the bottom? It’s the change that’s important. They switch it up because human beings are better at sensing change than at noticing details. And it’s also commonly shared know-how that changing the position of ads gets more people to notice it. Think of all the ad-supported sites you use. You can remember where the ads are located, even if you’ve never bothered to look at a single one. Advertising and its strategies are changing rapidly in the modern world. In just 10 years, things like personal cameras and… go on →

Intel Centrino Wireless-N 2200 Ubuntu 1Mbps Workaround

The new power management features enabled in the Intel Centrino Wireless-N 2200 Wifi Card aren’t supported as of Linux Kernel 3.4.0-030400-generic. In 802.11n mode, this wifi card will sometimes drop down to 1 Mbps and stop receiving data altogether. Symptoms Run lspci -v and make sure that your wireless network controller has iwlwifi listed next to Kernel driver in use. Network packets are lost and iwconfig shows current network speed as 1Mbps. To fix this, you can either turn off power management or disable 802.11n on the wireless card. Option 1: Turn off power management 1. Run the following command, where wlan0 is the identifier for your wireless card. #… go on →

The Student Planner

Lots of college stores sell weekly planners to help you get organized, and with a busy life, organized you must be. In picking your student planner, I present these tips: Be prepared to blow some money. Chances are you’re going to be keeping this thing for a year, so don’t be stingy. Inexpensive doesn’t always imply bad quality, but it’s usually a damn good indicator. Gridded, lined, or blank. You are much better off delineating the structure of your own planner than buying a pre-structured one. Don’t torment yourself with stupid preallocated spaces for days and weeks. I personally prefer gridded pages because they encourage use of grids and tables… go on →

How to create a secret picture blog with text messages

I maintain a hidden blog that receives pictures and texts (MMS, SMS) from my cell phone and posts them chronologically with WordPress. It is like a picture journal, but for times when writing is not particularly convenient, since all I need is my phone. This tutorial requires a cell phone with a messaging plan, a spare gmail account, and web hosting. No data plan is required. Create a gmail account that is dedicated to this project specifically. Add the address as a contact in your cell phone. Most carriers allow you to send text messages and multimedia messages to email addresses. Verify that yours does. Set up a WordPress blog… go on →

CRUD Operations 1: Create

Part 2: Creating database tuples – There are four primary operations to modify table data in SQL databases. Keep in mind that the following are only operations for modifying data, and that there are many more operations used to modify table structure, modify database structure, user privileges, and interrelational (between tables) operations.

Fundamentals of Databases

Part 1: Introduction to Relational Database Theory – databases and schema. Databases are a fundamental part of many enterprise-level applications. Virtually all websites on the Internet today are essentially just an interface to a database. Content is created by the user, read by the user, and edited by the user.

Fundamental Terminal Shortcuts

The linux command line interface is a powerful tool and a professional alternative to a graphical user interface. The keyboard shortcuts listed here are essential to using the terminal efficiently. In traditional computer documentation, the ^ symbol was used to indicate the Control Key. For example, ^C translated to Ctrl + C. ^C halts the current process. It can be used to interrupt a running process, stopping a server process, or getting a new terminal prompt to type on. ^D signals the End of File (EOF) character. It can be used to logout of a ssh or teletype (tty) session, to close a terminal window, to end a telnet session,… go on →

How Email is Sent

Email is an old-as-time standard. After dozens of published documents that altogether document the format, transmission, and access of email through email infrastructure, the email standard has been adopted across all age groups as the most professional and standard form of Internet communication today. They were officially known as ARPA Internet Text Messages, later called Electronic Mail Messages, and now colloquially known as email. Nearly all email today is sent and received either using a website interface such as Gmail or through one of several email clients. Email clients range from full-blown suites like Microsoft Office Outlook to mobile platforms on the iPhone. The program through which a human being… go on →

5 Quirks of JavaScript that You Should Know

The quirks of JavaScript listed here are ones that I techniques that I employ with frequency, possibly with the exception of the last one. Some people criticize JavaScript because of its misunderstood semantics, but once you put these quirks to use, you will see what a powerful language JavaScript can be. Infinity and its counterpart -Infinity are numbers in JavaScript. Try it out: >> 1/0 Infinity >> typeof(1/0) “Number” The easiest way to convert a string into a base-10 integer isn’t with parseInt(). It’s actually: >> +”234″ 234 The three-part tenary operator is very useful for quick one-liners when more if-blocks is the last thing you need: if (store.isOpen){     return… go on →

Understanding System Memory

Memory is one of the primary price-determining factors when buying server hardware or virtual server hosting. It is therefore important to monitor and understand memory usage. To get an overview of system memory usage, use the following: $ free -m The m switch tells free to display the numbers in terms of megabytes. Other possible options include b for bytes, k for kilobytes (default), and g for gigabytes. The first row lists total, used, and free physical memory. Physical memory refers to the memory that is provided by physical memory sticks on your machine, as opposed to virtual memory which is the space that your computer borrows from a long-term… go on →

Tools to Monitor Disk Usage

The linux command line provides several utilities to monitor disk usage. To see disk usage for each file system, use the following: $ df -Th The T flag tells df (disk free) to list the file system types. The h flag tells df to show the numbers with human-readable suffixes such as G for gigabyte and M for megabyte. To see the disk usage for a specific directory, use the following: $ du -hd1 The h flag again makes the numbers human-readable. The d flag tells du how detailed it should list per-directory folder sizes. A value of 1 tells du to list the size of the directory and its… go on →

Temperature and Fan Speed with lm-sensors

The following tutorial requires root terminal access. It also will not work on virtual servers, only on dedicated machines. This program lets you access temperature sensors and fan speed sensors on your system. Root access is required to detect the sensors, but not to read them. This will only work for systems running on bare metal, as opposed to a virtual server. Install the lm-sensors package with the following: $ sudo apt-get install lm-sensors Then, let sensors find which temperature sensors are available on your system with: $ sudo sensors-detect Accept the defaults to the prompts. If sensors-detect fails, check to make sure you are running as root and that… go on →

Using Telnet to Test TCP Services

The following introduction is based on telnet, a program that is found in virtually all computer systems. It does not require root privileges and can be run on a virtual machine over a terminal. Originally, telnet [host address] was used to remotely administrate servers over a network, but it was extremely insecure and has been replaced with ssh. Nonetheless, telnet is useful for quickly setting up TCP connections and testing out certain services. To connect to port 80 to test a web server, use the following: $ telnet syntaxionist.rogerhub.com 80 Output similar to the following will appear: Trying 50.116.11.45… Connected to syntaxionist.rogerhub.com. Escape character is ‘^]’. You have a couple… go on →

Introduction to Tar

The following introduction is based on tar, a program that is found in virtually all linux systems. It does not require root privileges and can be run on a virtual machine over a terminal. Copying a large number of files over ftp or sftp involves a lot of overhead because each file needs to be transferred and recreated separately. The linux command tar creates archives that condense a large number of files into one. By default, each file is appended to the end of the previous one, with an archive roughly the total size of the original files. To create an archive of a folder: $ tar cvf [archive name]… go on →

5 Useful Linux Administration Tools

sensors This program lets you access temperature sensors and fan speed sensors on your system. Root access is required to detect the sensors, but not to read them. This will only work for systems running on bare metal, as opposed to a virtual server. Install the lm-sensors package with the following: $ sudo apt-get install lm-sensors Then, let sensors find which temperature sensors are available on your system with: $ sudo sensors-detect Accept the defaults to the prompts. If sensors-detect fails, check to make sure you are running as root and that you are not running on a virtual machine. Then, get readings from the sensors with: $ sensors Reading… go on →

Rotate Rails Logs with logrotate

This technique requires root shell access. The logrotate program on linux servers handles rotation and compression of system logs. When logs get too big after being written to for a long time, logrotate will take the old log data and archive it somewhere else. By default, logrotate only watches system logs which are usually located in /var/log/. To rotate Rails logs, a bit of configuration is needed. Verify that the logrotate cron job (scheduled task) is enabled with the following: $ ls /etc/cron.daily Make sure logrotate is scheduled. The configuration file for logrotate is located at /etc/logrotate.conf. To enabled log rotation of Rails logs, open it up with your preferred… go on →