KoRoVaMiLK# linux microblog

  • Random
  • Archive
  • RSS
  • Ask me anything

Debian Wheezy and Foreman friends again

Latest Debian major release, Wheezy, ships by default with Ruby Sinatra 1.3.2 and you know what? Foreman will not play well with it!

As an example, I couldn’t provision new hosts (a generic error code 400 was thrown, plus lot of ruby complaints on the foreman-proxy log).

Thanks to the amazing guys on #theforeman channel at irc.freenode.net I was pointed to the quick and dirty fix: downgrading Sinatra to the previous working version (1.3.1).

Here we go:

Uninstall default Sinatra (leave dependencies where they are)
dpkg  --force-depends -r ruby-sinatra

Move to your Foreman folder:
cd /usr/share/foreman

Install Sinatra 1.3.1 from gems
gem install sinatra -v 1.3.1

Check:
gem query

*** LOCAL GEMS ***

bundler (1.2.2)
[...]
sinatra (1.3.1)

Done!

    • #theforeman
    • #puppet
    • #debian
    • #wheezy
    • #ruby
    • #sinatra
    • #foreman
    • #linux
  • 6 days ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Enhance vim editor with pathogen

With pathogen.vim you can install plugins and runtime files for vim in a flash. It will be as simple as downloading them in the ~/.vim/bundle directory.

Create directory tree:

mkdir -p ~/.vim/autoload ~/.vim/bundle

 

Download pathogen.vim:

curl -Sso ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim

 

Edit your ~/.vimrc to add these lines:

" Enable pathogen
"
execute pathogen#infect()

" OPTIONAL: You may also wish to have Vim jump to the last position when reopening a file
" 
if has("autocmd")
  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
    \| exe "normal! g'\"" | endif
endif

From now on, when you wish to install new plugins, just jump to ~/.vim/bundle and extract (or git clone) them here.

Example usage: 

Let’s install vim-sensible plugin: “a universal set of defaults that (hopefully) everyone can agree on”

cd ~/.vim/bundle
git clone git://github.com/tpope/vim-sensible.git

Done!

 

You may want to visit the projects’ page at GitHub:

http://github.com/tpope/vim-pathogen

http://github.com/tpope/vim-sensible

vim.pathogen on official vim website: 
http://www.vim.org/scripts/script.php?script_id=2332

    • #vim
    • #linux
    • #editor
    • #tricks
  • 1 month ago
  • 1
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Speed up OpenPGP key creation on remote server

Since creating an OpenPGP key requires some randomness (eg. move mouse, reading or writing from/to File System), the process of creating it on a remote connected host (via ssh) may take a lot of time or even get stuck.
To collect the needed entropy you can connect to the server from another SSH connection and perform some I/O task like in the following examples:

ls –R /
(recursive listing of all files in the File System)

find /var/ /usr /lib /srv -type f -print0 | xargs -0 md5sum > /dev/null
(sends to /dev/null the md5sum of all files in /var /usr /lib /srv)


..This saved my day! :)

    • #OpenPGP
    • #PGP
    • #gnupg
    • #gpg
    • #ssh
    • #linux
  • 1 month ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Show active network interface and current IP address at TTY console login prompt

I have several virtual linux guests running on VirtualBox: a bunch of test machines to which I connect exclusively via ssh from my host terminal.

Virtualbox setting for their network adapter is usually set as bridged, in order to acquire the IP address from the DHCP server of the network I am connected to. 

I find it annoying to login on the console after every boot to check the current IP address, then logging out and connect via ssh.. that’s why I came up with the following script. Essentially it appends (‘echoes’) the currently connected network interfaces (and relative IP) to the welcome message showed at tty console login prompt after boot (/etc/issue). Some little trick was needed to preserve the original content of /etc/issue and being pleasant to the eye.

Save it somewhere on your virtual machine filesystem (a good place could be /etc/init.d/), make it executable (chmod +x /etc/init.d/boot_prompt.sh) and then add a reference to its full path into /etc/rc.local just before the exit 0 line:

/etc/init.d/boot_prompt.sh
exit 0
 

Enjoy!

Screenshot of an example boot prompt:

image

    • #bash
    • #shell
    • #script
    • #linux
    • #virtualbox
  • 1 month ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Install F18 x86_64 from USB: Reduce ISO size to fit 4GB usb stick

No dvd at home, only a 4GB usb stick but in need to install Fedora on a laptop.. and then you realize that the iso image is slightly more than 4gb (ie. Fedora-18-x86_64-DVD.iso is about 4.3GB).
Here it comes isomaster.

Just install it via yum:
yum install isomaster

Launch it and select the path where your iso image is saved. Isomaster will open the iso and let you navigate inside the directories and the files contained by the image. Now you can delete unnecessary files until you have the desired size.

For example, if you plan to use Gnome as desktop environment, you may safely delete all KDE-related packages (navigate to the “Packages/k” directory, select all the packages starting with kde* and then hit DEL): you will end up with a 3.7GB iso that now you can burn into the 4GB usb stick via unetbootin.
 

    • #linux
    • #usb
    • #fedora
    • #install
    • #isomaster
    • #unetbootin
  • 1 month ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Page 1 of 7
← Newer • Older →

Logo

KoRoVaMiLK# linux microblog

something more than a tweet, slightly less than a real blog.. somewhere around a technical sketchpad

Pages

  • bio
  • links

about:me

  • Linkedin Profile
  • korovamilk on github

@korovamilky tweets

loading tweets…

Top

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile
Effector Theme by Pixel Union