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: , ,
Follow

Get every new post delivered to your Inbox.

Join 62 other followers