Fedora 20 desktop setup

Posted by jason on Sept. 6, 2014, 12:33 p.m.
Tags: fedora linux sysadmin

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

Posted by jason on Sept. 6, 2014, 9:05 a.m.
Tags: fedora linux steam sysadmin

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

Posted by jason on Jan. 30, 2013, 6:12 a.m.
Tags: bash linux

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

Posted by jason on Feb. 17, 2012, 12:38 p.m.
Tags: cups linux 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

Posted by jason on Feb. 3, 2012, 6:31 a.m. - 6 comments
Tags: centos config hostapd linux sysadmin

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

Posted by jason on Jan. 30, 2012, 12:39 p.m.
Tags: arch centos linux sysadmin

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

Posted by jason on Jan. 27, 2012, 6:43 a.m.
Tags: centos config linux vim

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

Posted by jason on Dec. 6, 2011, 7:13 a.m.
Tags: arch awesome config i3 linux

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

Posted by jason on Nov. 4, 2011, 6:25 a.m.
Tags: bash linux programming

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

Posted by jason on Oct. 25, 2011, 10:18 p.m.
Tags: bash linux programming regex

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

Posted by jason on Oct. 22, 2011, 10:58 a.m.
Tags: arch awesome config linux widgets

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

Posted by jason on Sept. 30, 2011, 7:34 a.m. - 1 comment
Tags: arch linux sysadmin

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

Posted by jason on Aug. 13, 2011, 3:13 p.m. - 1 comment
Tags: arch config linux sysadmin

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

Posted by jason on July 21, 2011, 3:45 p.m. - 10 comments
Tags: arch awesome config linux widgets

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

Posted by jason on June 23, 2011, 10:53 a.m.
Tags: linux sysadmin

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 for all files matching and delete them. Not that you need to escape special characters in the with a backslash.

Play it safe

You ...


Make SSH stop asking for a login password

Posted by jason on June 13, 2011, 10:15 p.m.
Tags: linux sysadmin

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.

  1. Open a terminal
  2. Go to your .ssh folder
  3. cd ~/.ssh
    
  4. Check if you have a 'id_rsa.pub ...

Testing a Website Before DNS Propogates

Posted by jason on June 10, 2011, 9:45 p.m.
Tags: dns linux web

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

Posted by jason on June 1, 2011, 5:28 p.m.
Tags: arch linux php vim xdebug

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

Posted by jason on May 21, 2011, 6:19 a.m.
Tags: linux vim

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 ...