Archive

Archive for the ‘Uncategorized’ Category

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.

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

calling gsettings from crontab

February 6, 2014 Leave a comment

Problem
I have a script that updates my desktop wallpaper every midnight with the Bing background image (see bing.py here).

This script worked fine, but a few months ago it stopped updating my desktop. Today I had some time and tracked down the problem to the gsettings command. The script sets the background with this external command:

gsettings set org.gnome.desktop.background picture-uri file:///absolute/path/to/image.jpg

When I launched the script manually, the background was refreshed. However, when it was called from crontab, the background was not refreshed. gsettings actually set the new image, but the background was not refreshed, so I still saw the old image. Wat?

Solution
I found the solution here. As Radu Rădeanu points out, the only environment variable that is required to run the script correctly as a cron job is the DBUS_SESSION_BUS_ADDRESS, not DISPLAY or XAUTHORITY or GSETTINGS_BACKEND or something else.

Here is how to set the value of DBUS_SESSION_BUS_ADDRESS:

PID=$(pgrep gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)

Now my crontab file looks like this:

HOME=/home/jabba
DISPLAY=:0
PYTHONPATH=$PYTHONPATH:$HOME/python/lib/jabbapylib

0 0 * * * $HOME/bin.python/bing.sh

The source of bing.sh:

#!/usr/bin/env bash

HOME=/home/jabba
DISPLAY=:0
PYTHONPATH=$PYTHONPATH:$HOME/python/lib/jabbapylib
PID=$(pgrep gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)

DIR=$HOME/Dropbox/python/lib/jabbapylib/jabbapylib/apps
$DIR/bing.py >>$HOME/bing.log.txt

free programming books

January 20, 2014 Leave a comment

sending vim to background then bringing it back

December 13, 2013 Leave a comment

Problem
You are working in vim and you want to switch quickly to the terminal to do something. Then you want to get back to vim and continue editing where you left off.

Solution
Simply do the same you do with other programs:

  • CTRL+Z: suspends vim and you find yourself in the terminal
  • do your terminal business
  • fg: brings you back to vim
Categories: Uncategorized Tags: ,

sachet: customize your vim through a web interface

December 13, 2013 Leave a comment

Vim is a very nice text editor but for its full potential, you need a good config. file :) If you are new to vim, you can start with sachet. Sachet is a web application where you select the features you want in your vim editor and it prepares the config. file for you that you can download and install. Simple!

sachet allows you to handcraft your VIM development environment. By allowing you to select features and functionality that you are comfortable with, sachet generates you a small package with the appropriate configuration files, plugins, and theme so you can leverage the potential of your VIM editor.” (source)

Later on you can customize your .vimrc file.

Categories: Uncategorized Tags: ,

Learn Vimscript

December 13, 2013 Leave a comment

I don’t want to encourage anyone, but if you are interested in customizing your vim editor, check out Learn Vimscript the Hard Way.

The book is divided roughly into three sections:

  • The first covers basic Vim commands that you can use in your ~/.vimrc file to customize Vim quickly and easily.
  • The second looks more deeply at Vimscript as a programming language, covering things like variables, comparisons, and functions.
  • The third walks through the creation of a sample plugin intended for distribution to other Vim users.
Categories: Uncategorized Tags: ,

gg.gg can shorten any URL

December 13, 2013 Leave a comment

I found this treasure in this thread.

The short URL http://gg.gg/rrg9 points to a URL that is 11,554 characters long. Wow! (This long URL contains a regular expression that validates an email…)

Do you know any other URL shortener that can process such long URLs? If yes, then please leave a comment.

30 Technologies in 30 Days

November 25, 2013 Leave a comment

Shekhar Gulati took on the challenge of learning 30 new technologies in 30 days and blogging about each day. He hasn’t missed a day. His goal is to get familiar with many of the new technologies being used in the developer community and how each one can work on OpenShift. See the landing page of all the technologies he’s learned so far.” (from OpenShift newsletter, Nov. 2013)

Categories: Uncategorized

Improve your shitty posture

November 16, 2013 Leave a comment

Do you sit hours in front of your computer every day? Then very likely you have a bad posture. Here is how to improve it:

from reddit

Categories: Uncategorized Tags: , , ,
Follow

Get every new post delivered to your Inbox.

Join 62 other followers