Save readonly file in vim

Save a file in vim when opened readonly
Read more →

Linux Hardware Detection Tool Dmidecode

While searching for a quick method of checking a systems memory type, I stumbled upon the dmidecode tool. Dmidecode was able to pull all of the memory information from my motherboard. Including open memory slots and values of the occupied ones. Usage Usage: dmidecode [OPTIONS] Options are: -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) -h, --help Display this help text and exit -q, --quiet Less verbose output -s, --string KEYWORD Only display the value of the given DMI string -t, --type TYPE Only display the entries of given type -u, --dump Do not decode the entries --dump-bin FILE Dump the DMI data to a binary file --from-dump FILE Read the DMI data from a binary file -V, --version Display the version and exit dmidecode run without any options will dump everything it can determine from the Desktop Management Interface (dmi).
Read more →

apt-get package management

apt-get is the package management utility behind Debian-based Linux systems Ubuntu, Mint and Mepis. A complete list of distributions based on Debian can be found on Distrowatch. Basic Package Management: apt-get update Used to resynchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive, this command retrieves and scans the Packages.gz files, so that information about new and updated packages is available.
Read more →

Archlinux Kernel Repair

{%- include toc.html -%} So I managed to uninstall my kernel In an effort to get VMware Workstation running I needed to downgrade my kernel. I installed the new kernel and got everything setup. Sometime later the system reverted to the newer version. I already had the package exclusion IgnorePjg = linux, linux-headers in pacman.conf. So I decided to purge the newer kernel 3.16 from the system. After doing so, I reinstalled the downlevel kernel 3.
Read more →

Archlinux Powerpill Setup

Arch Linux Powerpill Setup Powerpill is a wrapper for Archlinux package management tool, pacman. This is a short tutorial on setting up powerpill for concurrent downloads without using the reflector. Powerpill is a wrapper script written by Xyne for pacman that speeds up package retrieval by using aria2c for concurrent/segmented downloads. It determines the target packages of requested synchronization operation and then uses the mirrorlist to create a comprehensive metalink. This metalink is then piped to the download manager aria2 for package retrieval.
Read more →

Bash 4 recursive globbing

Bash version 4 introduced a new option called globstar. When the option is set, recursive globbing with ** is enabled. Lets say you want to move all files from a directory and its subdirectories. Most common method would be to use the find command. For example, find and move all .mp3 files from the current and all subdirectories to a directory named music. $ sudo find . -type f -exec mv *.
Read more →

Batch convert images with ImageMagick

Batch convert image files with ImageMagick I recently had a number of SVG images that needed to be converted to PNG. There are a few applications that are capable of converting (Gimp, Photoshop, etc). However I wanted something simple that could batch convert them. Little did I know I already had it installed. The application is called ImageMagick. mogrify -format png *.svg There are an incredible number of options available. Head on over to the ImageMagick site for more details.
Read more →

BOINC cli for World Community Grid

{%- include toc.html -%} BOINC - Berkeley Open Infrastructure for Network Computing BOINC is a distributed [grid] computing client that uses idle time on your computer. There are a number of projects that you can attach to and assist with. I will cover how to connect to the World Community Grid via CLI on Ubuntu. World Community Grid World Community Grid’s mission is to create the world’s largest public computing grid to tackle projects that benefit humanity.
Read more →

BOINC Linux GPU

As of version 7.0.40 BOINC has the ability to split GPU tasks across multiple work units. Preliminary Change Log 7.0.39 –> 7.0.40: client: add “client app configuration” feature; see This lets users do the following: limit the number of concurrent jobs of a given app (e.g. for WCG apps that are I/O-intensive) Specify the CPU and GPU usage parameters of GPU versions of a given app. BOINC development versions are found here: http://boinc.
Read more →

Curses based full screen BOINC manager

Read more →

Determine if your processor is 64bit capable

Determine if your processor is 64bit capable Grep the output of /proc/cpuinfo for the lm (long mode) flag. grep lm /proc/cpuinfo flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm ida dts tpr_shadow vnmi flexpriority flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm ida dts tpr_shadow vnmi flexpriority Long Mode (lm) description via Wikipedia:
Read more →

Fix Shrew Soft VPN on Ubuntu 11.04

Read more →

Getting the most from GNU Screen

Via gnu.org Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Each virtual terminal provides the functions of the DEC VT100 terminal and, in addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO 2022 standards (e.g., insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows the user to move text regions between windows.
Read more →

Identify CPU architecture on Linux

Using lscpu is a quick and easy way to determine your CPU architecture. 64bit AMD processor example $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 6 On-line CPU(s) list: 0-5 Thread(s) per core: 1 Core(s) per socket: 6 Socket(s): 1 NUMA node(s): 1 Vendor ID: AuthenticAMD CPU family: 16 Model: 10 Model name: AMD Phenom(tm) II X6 1055T Processor Stepping: 0 CPU MHz: 800.000 CPU max MHz: 2800.
Read more →

Medibuntu Repositories

Medibuntu (Multimedia, Entertainment & Distractions In Ubuntu) is a repository of >packages that cannot be included into the Ubuntu distribution for legal reasons >copyright, license, patent, etc). Some of these packages include the libdvdcss package from VideoLAN and the external >binary codecs package (commonly known as w32codecs) used by MPlayer and xine. The following one line command will add Medibuntu repositories to the sources.list, install the Medibuntu GPG key and resynchronize the package index:
Read more →

Network Bonding

Details on setting up network bonding. This is going to be used as a Snort sensor on a passive network tap. Install ifenslave $ sudo apt-get install ifenslave Create the file /etc/modprobe.d/bonding.conf with the following: alias bond0 bonding options bonding mode=0 miimon=100 A note about promiscuous mode regarding the bonding mode: Promiscuous mode When running network monitoring tools, e.g., tcpdump, it is common to enable promiscuous mode on the device, so that all traffic is seen (instead of seeing only traffic destined for the local host).
Read more →

Packer CentOS Virtualbox image

SATA Wanted Many of the public CentOS Vagrant boxes are configured with only an IDE controller. I assume this is for compatibility reasons. The SATA controller on VirtualBox performs better, so that is what I want. Serial ATA (SATA) Like a real SATA controller, Oracle VM VirtualBox’s virtual SATA controller operates faster and also consumes fewer CPU resources than the virtual IDE controller. Also, this enables you to connect up to 30 virtual hard disks to one machine instead of just three, when compared to the Oracle VM VirtualBox IDE controller with a DVD drive attached.
Read more →

Persistent Gnome shell in Lucid

GNOME Shell is the defining technology of the GNOME 3 desktop user experience. It provides core interface functions like switching to windows and launching applications. GNOME Shell takes advantage of the capabilities of modern graphics hardware and introduces innovative user interface concepts to provide a delightful and easy to use experience. Availability and Status The GNOME Shell is currently in active development and while many planned features are not yet implemented it is stable enough for everyday use.
Read more →

Powerline on Archlinux

Powerline on Archlinux I recently switched from GNU Screen to Tmux. While reviewing random tmux.confs on Github I stumbled onto the screenshot below of tmux & powerline. Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile. https://github.com/gpakosz/.tmux An AUR package available for Powerline. However for this document I am going to detail the standard installation.
Read more →

Remove ctrl-m characters on Linux

Read more →

Set recursive file or directory permission

Read more →

Solarized colors on Gnome terminal

Solarized is a beautiful color palette. The palette was designed for readability and comes with both light and dark options. Solarized is a sixteen color palette (eight monotones, eight accent colors) designed for use with terminal and gui applications. It has several unique properties. I designed this color scheme with both precise CIELAB lightness relationships and a refined set of hues based on fixed color wheel relationships. It has been tested extensively in real world use on color calibrated displays (as well as uncalibrated/intentionally miscalibrated displays) and in a variety of lighting conditions.
Read more →

Ubuntu Lucid performance tweaks

I use these setting on a laptop with a Core 2 Duo and 4 GB of ram. It might seem like overkill to tweak this system. However since it is a work machine at any time I am running Lotus Notes, VirtualBox, OpenOffice, Chrome, etc. Should you have a system with limited resources I would recommend Xubuntu for a light full-featured DE. Another option and very light on resources would be any of the open|flux|blackbox window managers.
Read more →

Uninstall LibreOffice on Redhat/Fedora

Read more →

Unrar multiple files

Read more →

Warning failed to load theme

While recklessly installing/testing some new themes I broke my GUI. Nothing seemed to be working right. After rebooting the box I was sitting at a blank screen. A quick check of ps -aux showed Gnome and Xorg running. What gives? Fired up journalctl and saw a bunch of these listed. Yep that looks like a place I might have screwed up. gnome-session[7460]: Window manager warning: Failed to load theme "Adwaita": Failed to find a valid file for theme Adwaita gnome-session[7460]: Window manager warning: Failed to load theme "Simple": Failed to find a valid file for theme Simple gnome-session[7460]: Window manager warning: Failed to load theme "ThinIce": Failed to find a valid file for theme ThinIce gnome-session[7460]: Window manager warning: Failed to load theme "Zukitre": Failed to find a valid file for theme Zukitre gnome-session[7460]: Window manager warning: Failed to load theme "Default": Failed to find a valid file for theme Default gnome-session[7460]: Window manager warning: Failed to load theme "Emacs": Failed to find a valid file for theme Emacs gnome-session[7460]: Window manager warning: Failed to load theme "Redmond": Failed to find a valid file for theme Redmond gnome-session[7460]: Window manager warning: Failed to load theme "Moka": Failed to find a valid file for theme Moka gnome-session[7460]: Window manager warning: Failed to load theme "Numix": Failed to find a valid file for theme Numix gnome-session[7460]: Window manager warning: Failed to load theme "Zukitwo": Failed to find a valid file for theme Zukitwo I quick Google search found a recommendation to reinstall the gnome-themes-standard package.
Read more →