Fedora 20 desktop setup
Here's what I do after a fresh Fedora 20 install:
No password sudo
$ sudo su -
$ visudo
Add this line at the bottom:
myusername ALL=(ALL) NOPASSWD: ALL
Update everything
Duh.
$ yum update
Install some nice programs
$ yum install vim rxvt-unicode-256color zsh mplayer
Add rpmfusion repo and install some good ...
Fedora 20 Steam OpenGL not using direct rendering
I had this problem after installing steam from rpmfusion:
https://support.steampowered.com/kb_article.php?ref=9938-EYZB-7457
I'm on 64-bit and this seems to be a 32-bit nvidia issue. The solution was to install the 32-bit nvidia drivers:
$ yum install xorg-x11-drv-nvidia-libs.i686
Bulk Rename Files in Bash
Let's say I have a set of files that all have the same thing wrong with the filename.
$ ls -1 *.ext
badname.other.stuff1.ext
badname.other.stuff2.ext
badname.other.stuff3.ext
I can substitute "badname" with "goodname" for all the files with the following command:
for i ...
Cups and PostScript problem: lpr file.ps not printing
I was having an issue with a perfectly valid postscript file that wasn't being printed when sending it to the printer with the lpr
command.
It turns out that cups likes to run postscript files through filters before sending it to the printer. Consider this from my /var/log ...
Hostapd on CentOS 6
Here's how I got hostapd working on my CentOS 6 box. This article (if you could call it that) is just a running commentary. I wrote it while figuring things out, so all the silly issues I encountered are included here. Yes, I could write this properly so that ...
NFS (v4) Shares on CentOS 6
Here's a few I had to do while trying to set up read-write NFS shares between a CentOS 6 NFS server and an Arch Linux client. The Arch Wiki NFSv4 page was a huge help.
Set up NFS domain
Edit /etc/idmapd.conf
on both the client and the ...
VIM: Remember cursor position
For those who like how vim under CentOS remembers the previous cursor position when you open a file, here's the relevant code from /etc/vimrc. Just put it in your ~/.vimrc file:
if has("autocmd")
augroup redhat
"When editing a file, always jump to the last cursor position
autocmd ...
Arch Linux: Open files directly from Chromium in i3 or Awesome
These instructions are for i3 without using a desktop environment like gnome or KDE. My problem was that I would download a file in Chromium, and when I tried to open it, it would open the file in firefox before being opened in the appropriate application. Here's the solution ...
Linux command line: recursively find all files with a given string
Here's a little script I wrote that I install on any linux server that I do any programming on:
#!/bin/sh
find . -type f -iregex '.*\.\(php\|html\|js\|css\|py\|lua\)$' -print0 | xargs -0 grep -n -i -H "$1"
Note that this searches all .php, .html, .js, .css, .py ...
Bash scripting: rename upper case file extensions to lower case
I recently had one of my quick-and-dirty bash scripts broken because I wasn't expecting to receive a bunch of files named *.JPG as opposed to *.jpg. "Yay! I get to improve my bash script!" I thought to myself. Here's a script that will look at the files in ...
Awesome WM widget tooltip example
I thought I'd post a simple example of how to set up a custom tooltip for a widget in Awesome.
This example will add an icon to a wibox, and when the user hovers over it, that machine's internal and external IP addresses will be shown. To do ...
Problems with Ethernet RTL8111/8168B controller in Arch Linux
Problem
After a fresh Arch Linux install, I was having problems with my ethernet card: it kept flaking out and ifconfig was showing a ridiculous number of dropped packets and errors.
Here's the exact card I have, as described by "lspci | grep -i ethernet":
07:00.0 Ethernet controller ...
An Example of Troubleshooting in Arch Linux
I recently had a rather obscure problem with my Intel 5100 wireless card in Arch Linux. I doubt you had the same problem--this post is meant to illustrate the thought process (or lack thereof) while troubleshooting a random issue in Arch Linux.
The Problem
I went about a month without ...
Awesome WM widgets configuration
I've been using Awesome WM for about six months, and I love it. The hard part was configuring everything--especially the widgets. Before using Awesome, I'd never seen nor heard of lua--the scripting language that awesome uses for its configuration files--but I am a programmer by trade, so it ...
Find and Delete Files Recursively from Linux Command Line
Here's a basic example of how to find files and delete them, recursively.
find -name -exec rm -rf {} \;
That command will look under the directory
Play it safe
You ...
Make SSH stop asking for a login password
Here's how to set things up so that typing "ssh user@host" will just log you in and not ask for a password. You should probably only do this with trusted machines.
- Open a terminal
- Go to your .ssh folder
- Check if you have a 'id_rsa.pub ...
cd ~/.ssh
Testing a Website Before DNS Propogates
When I want to migrate a website to a new server--or even launch a new site--I like to do it well in advance and make sure everything is behaving as expected.
As an example, if I migrate jasonmaur.com to a new server that has shared hosting with Apache VirtualHosts ...
VIM, Xdebug, and PHP 5.3 (compiled from source) on Arch Linux
I finally got sick of using echo statements to debug my PHP scripts, so I decided to install xdebug and use it from within VIM. I followed this guide, but there were some things that were specific to my setup--namely, using Arch Linux with PHP 5.3 compiled from source ...
My VIM Configuration
I use VIM as my main IDE when doing any sort of dev work. So, I invested a few hours configuring things so that it would behave a bit more friendly for me. Here are some features in my configuration:
- Tab completion
- Syntax highlighting
- Capital "H" and "L" move left ...