Archive

Author Archive

IDE for C under Windows

April 13, 2014 Leave a comment


Problem
A friend of mine asked me to help him in C programming. He has Windows. What IDE to use?

Solution
Code::Blocks is an excellent choice. It has an installer that also contains a C compiler. Awesome. Just install it and you are ready to develop. It has all the nice features that you expect from an IDE.

Code::Blocks is actually cross platform, thus it exists under Linux too! It’s also good for C++. It’s open source.

Categories: c programming language, linux, windows Tags: ,

38,157 quality wallpapers

April 6, 2014 Leave a comment

Here (reddit post) you can find a torrent file that points to an 18 GB archive that contains 38,000+ quality wallpapers. The images are collected from imgur.

I downloaded it and put their imgur IDs on Gist, see here.

building Aegisub on Ubuntu

March 23, 2014 Leave a comment

Problem
You want to install Aegisub from source.

Aegisub is a free, cross-platform open source tool for creating and modifying subtitles. Aegisub makes it quick and easy to time subtitles to audio, and features many powerful tools for styling them, including a built-in real-time video preview.” (source)

Aegisub is a wonderful piece of software. It makes subtitle creation almost trivial :)

Solution
Here I show you how to build Aegisub 3.1.2 on Ubuntu 13.10 (64 bit). I guess it would work with later versions too after some tweaks :)

Note that Aegisub requires wxWindows > 2.8!

Installation steps:

# install dependencies
$ sudo apt-get install build-essential libasound2-dev libass-dev libffms2-dev libfftw3-dev libgl1-mesa-dev libglu1-mesa-dev libgtk2.0-dev libhunspell-dev liblua5.1-dev
$ sudo apt-get install intltool
$ sudo apt-get install libboost-all-dev
$ sudo ldconfig    # not sure if necessary here

$ cd /opt/wxWidgets-X.Y.Z
$ ./configure --with-opengl && make && sudo make install
$ sudo ldconfig

$ cd /opt/aegisub-X.Y.Z/aegisub
$ ./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu
$ make && sudo make install

Aegisub’s “configure” gave me the following warning: “configure: error: Could not link against -lGL !“. I could solve this problem with (1) “install libboost-all-dev“, and (2) add “--with-boost-libdir=/usr/lib/x86_64-linux-gnu” to “configure“.

Links

Update (20130330)
I also wanted to install Aegisub on an older laptop of mine that runs Ubuntu 12.04. To make it work, I had to install older versions: wxWidgets-2.9.4 and aegisub-3.0.1. I tried different combinations but it was a failure. If you want to save some headache, use these versions :)

ménage de printemps (spring cleaning)

March 22, 2014 Leave a comment

Problem
My Dropbox folder was at 98.5%, so it was time to do some cleanup. Which directories are the largest? Which files are the largest?

Solution

alias top10dirs='du -hsx * | sort -rh | head -10'
alias top10files='find . -type f -print0 | du -h --files0-from=- | sort -hr | head -n 10'

The first one shows the top 10 largest directories, while the second one prints the top 10 largest files. Directory and file sizes are shown in a human-readable format.

Samples

$ top10dirs 
60M     20090629-deploy
60M     20090327-deploy
56M     kgm
55M     exist-deploy-v3-20100710
55M     exist-deploy-v3-20100521
...
==============================
$ top10files 
60M     ./20090629-deploy/20090629-deploy.zip
60M     ./20090327-deploy/20090327-deploy.zip
55M     ./exist-deploy-v3-20100710/exist-deploy-v3-20100710.zip
55M     ./exist-deploy-v3-20100521/exist-deploy-v3-20100521.zip
49M     ./exist-deploy-v3-20100409/exist-deploy-v3-20100409.zip
...

Credits

  • top10dirs is from here
  • for top10files I wrote a Python script, but reddit user farsass pointed out that it can be solved easier in the shell

Find the largest subdirectories

March 21, 2014 Leave a comment

Problem
The free space on your HDD is low. Which directories are the largest? What consumes so much space?

Solution
Install “ncdu“, which stands for NCurses Disk Usage.

ncdu (NCurses Disk Usage) is a curses-based version of the well-known ‘du’, and provides a fast way to see what directories are using your disk space.” (source: man)

For a command line solution, check out this post: How Do I Find The Largest Top 10 Files and Directories On a Linux / UNIX / BSD?

Categories: bash Tags: , , , ,

Share large files

February 27, 2014 2 comments

Problem
You want to share a large file (e.g. a 700 MB video) with a friend. How to do it?

Solution
Try https://www.wetransfer.com/ . With this service you can share files up to 2 GB! The files will be kept for 7 days. After uploading your file(s), you get a link that you can send to your friend.

Links

Sorry, Ubuntu has experienced an internal error

February 24, 2014 Leave a comment

ubuntu-12.04-apport-errorSorry, Ubuntu has experienced an internal error.

Does it sound familiar? Are you tired of these messages? Then let’s get rid of them:

sudo apt-get purge apport

More info here.

Update
On one of my machine the package rapport could be removed easily. However, on another machine the package manager wanted to remove a bunch of other packages too. In this case you can simply disable apport.

Edit the file /etc/default/apport and change enabled=1 to enabled=0. This setting will be taken into account on the next boot.

Categories: ubuntu Tags: , ,

LaTeX: strike through a text

February 17, 2014 Leave a comment

Problem
You want to have this effect in LaTeX.

Solution

\usepackage{soul}

You want to have \st{this effect} in \latex.
Categories: latex Tags:

Linux host, Windows guest, shared Dropbox folder

February 16, 2014 Leave a comment

Problem
My primary operating system is Linux but since I need to work with Powerpoint too, I installed Windows 7 in VirtualBox. Under Windows I prepare my presentations but I want them synchronized on all my machines. For the synchronization I was using Dropbox.

I had Dropbox on Linux (host machine) and on Windows (guest machine) too. When I edited a file under Windows, Dropbox synced it to the Linux host too (the Windows client uploads it to the cloud; the Linux client downloads it from the cloud). It worked fine, though it was not not optimal. If I didn’t use the Windows guest for a long time, then after a boot I had to wait some time till Dropbox synced everything and I could start working only after that.

However, something happened to the Windows Dropbox client recently. Maybe it’s a bug, I don’t know, but the Dropbox client in my Windows guest became terribly slow. It keeps syncing but it doesn’t upload the changes, or I need to wait an hour or so to upload a file 1 MB of size. This is ridiculous and unacceptable. Note that I dind’t experience similar issues with the Linux client.

How to have a synchronized folder between a Linux host and a Windows guest without a Dropbox client on the guest?

Solution
First I made sure that my Dropbox folders were synced between the host and the guest. After this I uninstalled Dropbox on Windows and removed the C:\Dropbox folder entirely. Since it was synced with the Linux host, I had an exact copy of the Dropbox folder on Linux. Then shut down the Windows guest.

Here (http://www.maketecheasier.com/share-files-in-virtualbox-between-vista-guest-ubuntu-host) you can find an excellent post on how to set up a shared folder between a Linux host and a Windows guest. On the Linux host I shared my Dropbox folder ($HOME/Dropbox) that appears now as a new drive in the Windows guest (G:\ in my case). Now, if I modify something under Windows, it will be visible immediately in the Linux file system that the Dropbox client on Linux will notice and sync.

With this I could solve two problems. First, when I boot up the Windows guest, I don’t need to wait for the Dropbox client to sync. Second, if I change something under Windows, it is still synced to the Dropbox cloud, though I have no Dropbox client on Windows anymore.

extract .tar.gz

February 15, 2014 Leave a comment
$ tar xvJf file.tar.xz
# or
$ tar xvf file.tar.xz
# or
$ tar --xz -xvf file.tar.xz

Why is *.tar.gz still much more common than *.tar.xz?

Categories: bash Tags:
Follow

Get every new post delivered to your Inbox.

Join 62 other followers