I have an old laptop connected to our TV that I use for watching downloaded movies / YouTube videos, etc. When watching YouTube videos for instance, the screensaver kicks in after a while. How to disable the screensaver temporarily?
The package “
caffeine-systray” solved the problem (available in AUR). It starts automatically and sits in the system tray. Right click on it and select “Disable Screensaver”. That’s all.
I wanted to test the status of my Dropbox client from the terminal. Actually, I wanted to write a script that executes an action when my Dropbox folder is fully synced. So I wanted to test the status if it’s “working” or “synced”.
I found the solution here. It turned out that Dropbox has an official command-line script that can do this and much more. First, get it:
wget -O ~/dropbox.py https://www.dropbox.com/download?dl=packages/dropbox.py chmod u+x ~/dropbox.py ~/dropbox.py status
This is a Python script, written in Python 2, thus I modified the first line to be “
This script can do several things for you:
$ dropbox.py Dropbox command-line interface commands: Note: use dropbox help to view usage for a specific command. status get current status of the dropboxd help provide help puburl get public url of a file in your dropbox stop stop dropboxd running return whether dropbox is running start start dropboxd filestatus get current sync status of one or more files ls list directory contents with current sync status autostart automatically start dropbox at login exclude ignores/excludes a directory from syncing lansync enables or disables LAN sync
Some years ago I wrote a simple script to get the public URL of a file in my Dropbox folder. This script can do that too with the “puburl” command.
There is a command line interface for Reddit called “rtv” (reddit terminal viewer). It’s written in Python, so you can install it with
Here is a short youtube video on how to use it.
$ ping -c 1 www.google.com ping: icmp open socket: Operation not permitted
$ sudo chmod u+s `which ping` $ ping -c 1 www.google.com PING www.google.com (220.127.116.11) 56(84) bytes of data. 64 bytes from ee-in-f104.1e100.net (18.104.22.168): icmp_seq=1 ttl=45 time=38.6 ms --- www.google.com ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 38.681/38.681/38.681/0.000 ms
In a folder I have lots of files, and the folder also has subdirectories with further files. I want to replace a string in all of them. I want to modify the files in place.
For instance, you want to update a bunch of Python scripts from version 2 to version 3, thus you want to modify the first lines from “
#!/usr/bin/env python2” to “
I found the solution here:
grep -rli 'old-word' * | xargs -i@ sed -i 's/old-word/new-word/g' @
WARNING! Since it modifies the files in place, be very careful! First run just the beginning of the command above:
grep -rli 'old-word' *
Refine it if necessary. If it finds exactly what you need, then proceed.