linux

warning: Creating default object from empty value in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/modules/taxonomy/taxonomy.pages.inc on line 33.
Leeland's picture

Shell Scripts That In-Line Java

Sometimes the simplest things get overlooked. There are many times where I need to do something a little cross system languages. For example dynamically deciding on the right arguments to feed to a Java tool or service JVM. Or when I need to do some undirected graph manipulations of data from PowerShell or bash. There is no reason to not step up to the higher level language to get the job done.

Leeland's picture

All of bash history revisited: load time solved plus directory history

Imagine logging into a box after a nice long three day weekend and asking yourself "self, what was I doing last Thursday?" or "what did I do on this server when I was here nearly a month ago?" What if you could answer that in such detail as what you did, where you were when you did it and you could get back there with only a few key strokes? Check this out (opening a new ssh session to my production box I haven't been on for weeks):
Using username "a-lartra".
Authenticating with public key "imported-openssh-key" from agent
  
Leeland's picture

All of bash history forever and across multiple sessions

The last terminal to exit wins the "who's history is saved" game. Unless you pull a cute Linux stunt or three.

Update: A better solution is now available All bash history revisited: Load time solved PLUS directory history

Leeland's picture

Rolling back Ubuntu updates is not exactly easy

In Ubuntu there are a number of ways to get upgrades. There is the update manager which is configured to run automatically. There is using the command line approach with apt-get ('sudo apt-get update && sudo apt-get upgrade'). Finally there is the GUI utility called Synaptic ('sudo synaptic').

So what happens when something gets updated and introduces a bug, or breaks another applications behavior?

Leeland's picture

Ubuntu Tidbits

== Table of Contents ==

__TOC__

== From Red Hat to Ubuntu ==

* Rosetta [https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora switching to Ubuntu from Red Hat Enterprise Linux, Fedora, and Centos]

== Disable Blank Console Screens ==

Leeland's picture

vim

I grew up using vi. Never got into emacs. Then along came vim. I ignored it of course. Then suddenly vi was gone and vim was quietly mapped to vi. Oh well, had to learn sometime.

== .vimrc ==
Almost all of my vim magic is embodied in my ~/.vimrc file.

au FileType * set tabstop=4|set shiftwidth=4|set noexpandtab
au FileType python set tabstop=4|set shiftwidth=4|set softtabstop=4|set expandtab
au FileType make setlocal noexpandtab|set softtabstop=4

" Make backspace a tad more friendly
set backspace=indent,eol,start
Leeland's picture

Disable Blank Console Screens for Ubuntu

I have a number of Ubuntu servers that boot up in text mode (both VMs and physical boxes). Once they boot I usually access them via ssh sessions so almost never try to type to console directly. However, it is rather annoying to want to see what is being sent to the console because I have to click and hit a keyboard key. So I had to find a way to permanently disable the blank screen feature for the consoles.

Now when you are logged in this is simple to do just enter the command:

$ setterm -powersave off -blank 0
Leeland's picture

Fixing piix4_smbus 0000:00:007.3: Host SMBus controller not enabled error for Ubuntu on VMware

Ubuntu guest instances in VMware from v8.x to the current v11.x sometimes come up with the boot error message:

piix4_smbus 0000:00:007.3: Host SMBus controller not enabled!

I still haven't figure out why this only happens with SOME of my instances. I think it has something to do with the magic mix recipe of installed packages. At any rate the error is being caused because VMware doesn't actually provide that level interface for CPU access. From Kernel documentation for "i2c-piix4" (<kernel source>/Documentation/i2c/busses/i2c-piix4):

Leeland's picture

Centos yum 404 repository errors

Today, I was attempting to upgrade my installed packages using yum on Centos Linux. Except that yum spun off into 404 land. The command looked like this:

$ sudo yum -y upgrade
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: centos.mirror.netriplex.com
 * base: mira.sunsite.utk.edu
 * extras: repo.genomics.upenn.edu
 * updates: centos.aol.com
http://centos.mirror.netriplex.com/5.5/addons/i386/repodata/repomd.xml:
[Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Leeland's picture

PuTTY SSH + default pointer + rdesktop = where is my mouse?

I work on a beefy Linux box with multiple desktops & monitors. I also have a windows laptop to do office junk and some testing. If my computers are side by side things are pretty sweet and I use Synergyc / Synergy2 (http://synergy2.sourceforge.net/) to make all my monitors flow together.

But, I also have another beefy Linux development box in a shared team space where again I have multiple desktops & monitors. No problem I just use rdesktop (http://www.rdesktop.org/)to make one of the monitors turn into my windows screen. All is fine in the world.

Leeland's picture

SED Recursive Search and Replace With Multiple Actions

About once every 6 months or so I end up needing to do a recursive search and replace across a whole bunch of files. Every time I need to do this I turn to SED as it is just so good at doing the work. But of course there is the problem of multiple actions.

The secret to this is using the SED file. This works across thousands of files on the local box and even more interestingly can be wrapped in a SSH script to walk hundreds of remote boxes.

Thread Slivers eBook at Amazon

Syndicate content