Archive

Archive for the ‘ubuntu’ Category

how to configure a Digital Ocean (or Linode, etc.) Ubuntu box

March 21, 2016 Leave a comment

I wrote a doc about it on GitHub: https://github.com/jabbalaci/DigitalOceanNotes . Following this guide I can set up a virtual private server (VPS) in 30-40 minutes.

upgrade tmux to the latest version

March 17, 2016 Leave a comment

What I love in Manjaro is that it contains the latest software versions. For instance, I installed tmux and on Manjaro it’s version 2.1.

On Ubuntu 14.04 it’s still version 1.8 in the reposotories…

Problem
How to upgrade tmux 1.8 to 2.1 on Ubuntu?

Solution
Install these packages:

$ sudo apt-get install exuberant-ctags cmake libevent-dev libncurses5-dev

Then download the source of tmux from the official home page. Then build and install:

$ ./configure && make
$ sudo make install

This tip is from here.

Categories: bash, ubuntu Tags: , ,

execute a command during boot as root

Problem
During the boot process you want to execute a command as root. For instance, I needed a symbolic link in /run, but /run is a virtual file system and its content is lost when you switch the machine off.

Solution
Edit the file /etc/rc.local . Example:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# this link is required by a project of mine
ln -s /media /run/media

exit 0

This tip is from here.

Categories: ubuntu Tags: ,

Getting started with the Rust programming language

December 24, 2014 Leave a comment

I heard a lot of good things about Mozilla’s Rust prog. language, so I decided to give it a try. A very nice starting point is The Rust Guide.

Installation

$ curl -s https://static.rust-lang.org/rustup.sh | sudo sh

I modified this script a little bit:

#!/bin/sh

DEST=/tmp

cd $DEST
rm -f $DEST/rustup.sh
wget https://static.rust-lang.org/rustup.sh -O $DEST/rustup.sh
sudo sh $DEST/rustup.sh

But it does the same thing. If you install Rust via this rustup.sh script, it has two advantages: (1) it installs the latest version of Rust, and (2) it also installs Cargo, the package manager and build system of Rust.

Print the version number: “rustc -V“.

Hello World

// hello_world.rs
fn main() {
    println!("Hello, World!");
}

Compile it with “rustc hello_world.rs“.

Troubleshooting
Under Ubuntu I had no problems, but under Manjaro got the following error: “rustc: error while loading shared libraries: librustc_driver-4e7c5e5c.so: cannot open shared object file: No such file or directory“.

Solution #1
Add the following line to your ~/.bashrc:

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib

Solution #2
Create the file /etc/ld.so.conf.d/rust.conf with the following content:

/usr/local/lib

Then execute the command “ldconfig” as root.

More info
Check out The Rust Guide.

Categories: manjaro, programming language, ubuntu Tags:

extracting conky settings from Parted Magic

December 19, 2014 Leave a comment

Two days ago I heard about Parted Magic, which is a live Linux CD offering a complete hard disk management solution. As I was checking out the screenshots, I noticed that it has a beautiful conky setting:

“I need that” was my first reaction :) So I grabbed a copy of Parted Magic, launched it in VirtualBox, and extracted the conky configuration. You can download it from here. My launcher script is here. Simply add the launcher to the list of startup applications.

Tip: if you want to play with conky, do it with Conky Manager. Here is how to install it.

shopt: change additional shell optional behavior

November 22, 2014 1 comment

There is a command called shopt that allows you to change additional shell optional behavior.

I use both Ubuntu and Manjaro and I noticed that sometimes bash behaved differently on Manjaro. For instance, I had a folder called “Test_me”. Once accidentally I wrote “cd test_me” and Manjaro entered the folder “Test_me” (notice the capital ‘T’) without any problem. Under Ubuntu it was impossible :)

As it turned out, the different behaviour is due to different shopt settings. In the example above, “cdspell” was on in Manjaro, while in Ubuntu it was off by default.

Since I use both systems and I want bash to behave similarly, I added these lines to the end of my ~/.bashrc:

# shopt settings (normalize Ubuntu and Manjaro)
shopt -s cdspell
shopt -s dotglob
shopt -s hostcomplete
shopt -s nocaseglob
shopt -u sourcepath

I switched “sourcepath” off. Read this post if you want to know why.

Categories: bash, manjaro, ubuntu Tags: ,

detect easily if your machine is frozen

October 6, 2014 Leave a comment

Problem
Very rarely my system gets frozen. But is it just my keyboard and mouse that have problems? Or is my whole machine frozen? Or is it just temporary and everything will be normal in a few seconds?

Solution
I have an easy solution to detect if the whole system is frozen. In the top right corner you have a clock, right? Well, add seconds too :) If the seconds are stuck, there is a problem. If they are moving, there is still hope.

clock

Update (20141014)
Yesterday my machine got frozen quite interestingly. I got an email with a youtube link that I wanted to play in Gmail. The machine got frozen, i.e. the mouse/keyboard had no effect and the clock didn’t move BUT the audio of the video was rolling :) I could do nothing but listen to it. At the end I had to restart the machine manually. Lesson learned: even if the clock is stuck, it doesn’t mean that your machine is completely frozen. (I guess this all happened because of Flash).

Categories: ubuntu Tags: ,
Follow

Get every new post delivered to your Inbox.

Join 87 other followers