Archive

Author Archive

[manjaro] XFCE theme looks strange after an update

April 27, 2016 Leave a comment

Problem
Manjaro had a major update at the end of April 2016 and after that my XFCE theme looked very strange.

Solution
In this thread I found that GTK3 was updated to version 3.20 and my current theme doesn’t support it. Solution: choose a different theme.

I chose the vertex-maia theme since it looks similar to my old theme. With Xfce Theme Manager I set this configuration:

  • theme: Vertex-Maia
  • windows borders: w8
  • icons: Menda-Circle
  • cursors: aero-drop
Categories: manjaro Tags: ,

listen to Pandora Radio, even if you are not a US citizen

April 21, 2016 Leave a comment

Problem
If you are a peasant like me living outside of the US but you still want to listen to Pandora Radio, which is only available in the center of world (USA), then what can you do?

Solution
There is a very simple solution now. Opera offers free VPN, built directly in the browser. You can choose between German, Canadian or American VPNs. Currently this feature is only available in the development version of Opera. So here are the steps:

  1. install Opera (development version)
  2. install Flash player for Opera (Pandora is a Flash-based website)
  3. visit pandora.com just to see that you are kicked out
  4. enable VPN: with Alt+P you can access the Settings, go to Privacy & security, then enable VPN
  5. Open an arbitrary site. On the left side of the URL bar you’ll see that VPN is activated. Click on it and select United States.
  6. Visit pandora.com again. Strangely, you are let in this time…

hacking with URL shorteners

April 18, 2016 Leave a comment

This article (https://freedom-to-tinker.com/blog/vitaly/gone-in-six-characters-short-urls-considered-harmful-for-cloud-services/) just gave me an excellent idea…

In a nutshell: these URLs are so short that you can explore a lot of them with a simple brute force approach. Just generate a random hash and there is a high chance that it points to somewhere.

Example: with bit.ly I generated a link: http://bit.ly/1bNGJd3 . I tried to modify some characters in the hash and in most cases it pointed to somewhere…

syntax highlight your code and paste in Word

April 14, 2016 1 comment

At http://planetb.ca/syntax-highlight-word you can find a nice syntax highlighter. It supports Python, HTML, Java, and several other languages. The rendered output can be copy-pasted to a Word document and it’ll look the same and remains editable in Word. Pretty cool.

It’s also useful if you want to make a screenshot of the syntax highlighted code. Here is an example:

sum

Thanks to Peter F. for the link.

vuze crashes after some time

April 12, 2016 Leave a comment

Problem
I like the bittorrent client Vuze but it crashes on some of my machines after a while.

Solution
I wrote a monitoring script that is checking if vuze is running. If vuze dies, the script restarts vuze automatically.

The source code is here: https://github.com/jabbalaci/Vuze-Restarter .

Categories: linux, manjaro, python

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.

tmux: a screen alternative

March 18, 2016 Leave a comment

A few days ago I wrote about the awesome tool screen. Then, some of my readers namely “i90rr _” and Rodnee suggested that I should try tmux (thanks for the tip). Actually, I tried it years ago, but since I didn’t have to work with SSH too much, it was not integrated in my daily routine. However, a few days ago I bought a Digital Ocean VPS to do some Python webapp development and now I do need ssh :) And without screen / tmux it would be a pain.

So, after screen, let’s see tmux.

tmux: an advanced and friendly terminal multiplexer

The scenario is the same:

ssh
From machine A, which is your local machine, you want to SSH to a remote server.

Log in with SSH:

ssh -p PORT USER@1.2.3.4

Specify the port if the SSH daemon is not on port 22. In the case of screen I used screen twice, but now I think it’s not necessary. First just use “ssh”. To keep the connection alive between machines A and B, it’s a good idea to use this alias:

alias ssh='ssh -o ServerAliveInterval=60'

More info about it here.

Once you are logged in to machine B, make sure that you have a recent version of tmux installed. More info here. And now just start tmux and use it :)

My config file

A big advantage of tmux over screen is its sane configation system. You can find my ~/.tmux.conf file here, I won’t copy it here.

Screenshot

My tmux looks like this:

tmux_screenshot
In the top right corner I also display my hostname and IP address, but it’s blurred out on the screenshot.

Detach

A very special feature of screen / tmux is the ability to detach. It means that you have several tabs open within tmux (tmux calls them “windows”), and pressing “Ctrl-b d” you can close tmux. However, the programs in its tabs are still running, they are not terminated! You can close SSH, even restart your local machine, it doesn’t matter. When you log in again to machine B with SSH, you can attach to this tmux session and voilá, there you have your tabs and every program is running.

For instance, you launch a program on the server that runs for hours. Just detach, and attach a few hours later to see the result of this program. Or, you log in to a remote server from home, launch some programs, detach, shutdown your local machine, go to your workplace, log in again with SSH and attach to tmux, and you continue where you left off at home.

I don’t want to write a tmux tutorial because others have already done it much better. So let’s see some links:

Links

Appendix

I use two simple scripts to make re-attaching easier. The first one is called “tm”:

#!/usr/bin/env bash

# tm

tmux list-sessions
echo "# tmux attach -t 0"

The second one is called “tm0”:

tmux attach -t 0

If you don’t give your tmux session a name (I don’t) then your session has ID 0. When I log in again to the remote server first I run “tm” to see the running sessions. Normally I only have one session, so its ID is 0. With “tm0” I can attach to it and continue my work in tmux. Easy peasy :)

Summary: to detach, press “Ctrl-b d”, and close SSH. To continue your work, log in with SSH, check sessions with “tm”, and attach with “tm0”. Easy peasy :)

Categories: bash Tags: , ,
Follow

Get every new post delivered to your Inbox.

Join 87 other followers