Archive

Archive for the ‘linux’ Category

increase sudo timeout

February 12, 2017 Leave a comment

Problem
You want to increase the sudo password remember timeout.

Solution
Run “sudo visudo“, then add this line to the end:

Defaults    timestamp_timeout=60

Where 60 means 60 minutes. If you specify -1, then the password is never forgotten (which is not a good idea IMO).

Tip from here.

Categories: bash, linux Tags: ,

Create a Windows installer USB stick from an ISO under Linux

September 30, 2016 Leave a comment

Problem
I decided to try Windows 10 and install it on a laptop of mine (worry not, it’ll be dual boot :)). Having an ISO, how to put it on a USB stick? In addition, Windows should install itself from the stick…

Solution
The software winusb did the job. Its usage is clear and simple:

$ winusb
Warning: you should run this script as root !
Error: No install method specified !

winusb usage
Install a windows ISO on an NTFS partition and edit MBR of the device
  winusb --install <iso path> <partition>
  Example: winusb win7_amd64.iso /dev/sdd1

Completely format a drive and install the ISO on it
  winusb --format <iso path> <device>
  Example: winusb win7_amd64.iso /dev/sdd

Options
 --verbose, -v        Verbose mode
 --help, -h           Show this help message and exit
 --noColor            Disable color

I had an empty USB stick with an NTFS partition, so I chose the “--install” method. The preparation of the USB stick is long, it took 15 minutes. Sometimes I had the impression that it got frozen but then it continued. So don’t worry, give it some time to finish.

Tip from here.

Categories: linux, windows, windows 10

Konsole: highlight the current tab

September 19, 2016 Leave a comment

Problem
Holy shit, this problem has been bugging me for years… But at last I found a solution.

So, I use the terminal emulator Konsole, which is very nice, I love it, but the current tab is not highlighted enough. Thus, if you have several tabs opened, it’s always difficult to figure out which is the current one.

konsole_off

Solution

It turns out that Konsole can be customized via a CSS stylesheet file. Here is an example (konsole.css) that you should save somewhere:

QTabBar::tab:selected {
    background: lightgreen;
    color: black;
    font: bold;
}

Then, in Konsole, go to Settings -> Configure Konsole… -> TabBar, and there specify this CSS file:

konsole_settings

And here is the result:

konsole_on

Links

Categories: linux Tags: , , , ,

setting the volume from the command line

Problem
I have a laptop where the default volume is weak. On the system tray the volume is on 100% but it’s still weak. So far I started the program “pavucontrol”, which is a GUI application, and there I set the volume to 150% (that’s the maximum). However, if I watch a youtube video and pause it, in pavucontrol the volume falls back to 100%, so I need to adjust it after each pause.

Solution
I found a command line program that allows one to set the volume. It’s independent of pavucontrol. So I made a script that runs automatically when the graphical interface comes up:

#!/usr/bin/env bash

#
# from http://askubuntu.com/questions/44680
# listing current volume:
#
#     pacmd list-sinks | grep volume
#

cmd="pacmd set-sink-volume 0 100000"
echo "#" $cmd
$cmd

First list your sinks with “pacmd list-sinks”. I only had one, hence the id 0. The value 100000 is the volume (on my system it’s equivalent to 153%). Value 65535 is volume 100%.

Tip from here.

Update (20160604)
I made a wrapper script around pacmd; you can find it here on GitHub. Its usage is very simple. Do you want to increase the volume? Just call “volume.py 140%” and you are done.

[mc] switch between horizontal and vertical panels

Problem
In Midnight Commander it can happen that a filename is too long and thus it is truncated. But still, you would like to see the complete filename.

Solution
switch from vertical to horizontal layout with Alt + ,

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.