Install Wikimedia editor on Windows

How to install Wikimedia editor:
Install node.js
Open a command line as admin.

npm install --global --production windows-build-tools

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Using cloudflare command line interface

You can easily change anything in your Cloudflare dashboard from the linux command line.

Install the cli

npm install -g cloudflare-cli

By default cfcli will look for “.cfcli.yml” in your home directory (you can also pass in a config file with -c). So create this:

emacs ~/.cfcli.yml
defaults:
    token: fcbe3cbb2894cb5f1871c89222851bf1
    email: [email protected]
    domain: oneofyourdomains.com

The token is actually the Cloudflare Global API key which you can retrieve from My Settings>Account>API Key menu.
All options:

NAME
    cfcli - Interact with cloudflare from the command line
 
SYNOPSIS
    cfcli [options] command [parameters]
 
OPTIONS:
    -c  --config    Path to yml file with config defaults (defaults to ~/.cfcli.yml
    -e  --email     Email of your cloudflare account
    -k  --token     Token for your cloudflare account
    -u  --account   Choose one of your named cloudflare accounts from .cfcli.yml
    -d  --domain    Domain to operate on
    -a  --activate  Activate cloudflare after creating record (for addrecord)
    -f  --format    Format when printing records (csv or table)
    -t  --type      Type of record (for dns record functions)
    -p  --priority  Set priority when adding a record (MX or SRV)
    -l  --ttl       Set ttl on add or edit (120 - 86400 seconds, or 1 for auto)
    -h  --help      Display help
 
COMMANDS:
    add <name> <content>
        Add a DNS record. Use -a to activate cf after creation
    devmode on|off
        Toggle development mode on/off
    disable <name> [content]
        Disable cloudflare caching for given record and optionally specific value
    edit <name> <content>
        Edit a DNS record.
    enable <name> [content]
        Enable cloudflare caching for given record and optionally specific value
    find <name> [content]
        Find a record with given name and optionally specific value
    ls
        List dns records for the domain
    purge [url]
        Purge file at given url or all files if no url given
    rm <name> [content]
        Remove record with given name and optionally specific value
    zones
        List domains in your cloudflare account

Provided examples:

Add a new A record (mail) and activate cloudflare (-a)

cfcli -a -t A add mail 8.8.8.8 
Edit a record (mail) and set the TTL

cfcli --ttl 120 edit  mail 8.8.8.8
Add an SRV record (then 3 numbers are priority, weight and port respectively)

cfcli -t SRV add _sip._tcp.example.com 1 1 1 example.com
Remove all records with the name test

cfcli rm test
Remove record with name test and value 1.1.1.1

cfcli rm test 1.1.1.1
Enable cloudflare for any records that match test

cfcli enable test
Enable cloudflare for a record test with the value test.com

cfcli enable test test.com
Export domain records for test.com to csv

cfcli -d test.com -f csv listrecords > test.csv
Purge a single file from cache

cfcli -d test.com purge http://test.com/script.js
Enable dev mode for test.com domain

cfcli -d test.com devmode on

My examples:

cfcli zones
┌──────────────────────────────────────────────────┬────────────────────┬──────────┬────────────────────────────────────────┐
│ Name                                             │ Plan               │ Active   │ ID                                     │
├──────────────────────────────────────────────────┼────────────────────┼──────────┼────────────────────────────────────────┤
│ mysite.com                                       │ Free Website       │ active   │ f81d72ad7d2a4af5e50060148389ede8       │
├──────────────────────────────────────────────────┼────────────────────┼──────────┼────────────────────────────────────────┤

Adding a CNAME record

cfcli -d eyrie.in -a -t CNAME add testrecord "joomla.com"
Explanation
-d : Work on this domain
-a : Activate the record
-t : type of DNS record
add : Add this record

Output:

Added CNAME record testrecord.eyrie.in -> joomla.com

Editing a DNS record:

cfcli -d eyrie.in -a -t CNAME edit testrecord "joomla.com"

List cloudflare records for a domain:

cfcli -d eyrie.in ls

Listing in comma seperated value (CSV) format:

cfcli -d eyrie.in ls -f csv

To export to text file:

cfcli -d eyrie.in ls -f csv > eyrie.in.csv

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Import files to seafile from cli

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8756C4F765C9AC3CB6B85D62379CE192D401AB61
echo deb http://dl.bintray.com/seafile-org/deb jessie main | sudo tee /etc/apt/sources.list.d/seafile.list
sudo apt-get update
apt-get install seafile-cli

Now setup cli:
# choose a folder where to store the seafile client settings e.g ~/seafile-client

mkdir ~/seafile-client            # create the settings folder
seaf-cli init -d ~/seafile-client  # initialise seafile client with this folder
seaf-cli start
seaf-cli is command line interface for seafile client.
Subcommands:
    init:           create config files for seafile client
    start:          start and run seafile client as daemon
    stop:           stop seafile client
    list:           list local liraries
    status:         show syncing status
    download:       download a library from seafile server
    sync:           synchronize an existing folder with a library in
                        seafile server
    desync:         desynchronize a library with seafile server
    create:         create a new library
Detail
======
Seafile client stores all its configure information in a config dir. The default location is `~/.ccnet`. All the commands below accept an option `-c <config-dir>`.
init
----
Initialize seafile client. This command initializes the config dir. It also creates sub-directories `seafile-data` and `seafile` under `parent-dir`. `seafile-data` is used to store internal data, while `seafile` is used as the default location put downloaded libraries.
    seaf-cli init [-c <config-dir>] -d <parent-dir>
start
-----
Start seafile client. This command start `ccnet` and `seaf-daemon`, `ccnet` is the network part of seafile client, `seaf-daemon` manages the files.
    seaf-cli start [-c <config-dir>]
stop
----
Stop seafile client.
    seaf-cli stop [-c <config-dir>]
Download
--------
Download a library from seafile server
    seaf-cli download -l <library-id> -s <seahub-server-url> -d <parent-directory> -u <username> -p <password>
sync
----
Synchronize a library with an existing folder.
    seaf-cli sync -l <library-id> -s <seahub-server-url> -d <existing-folder> -u <username> -p <password>

First retrieve the library id by browsing on the server -> it's in the url after "/repo/"

usage: seaf-cli sync [-h] [-c CONFDIR] [-l LIBRARY] [-s SERVER] [-u USERNAME]
                     [-p PASSWORD] [-d FOLDER]

optional arguments:
  -h, --help            show this help message and exit
  -c CONFDIR, --confdir CONFDIR
                        the config directory
  -l LIBRARY, --library LIBRARY
                        library id
  -s SERVER, --server SERVER
                        URL for seafile server
  -u USERNAME, --username USERNAME
                        username
  -p PASSWORD, --password PASSWORD
                        password
  -d FOLDER, --folder FOLDER
                        the existing local folder


desync
------
Desynchronize a library from seafile server
    seaf-cli desync -d <existing-folder>
create
------
Create a new library
    seaf-cli create -s <seahub-server-url> -n <library-name> -u <username> -p <password> -t <description> [-e <library-password>]
'''

Get library id:

seaf-cli list-remote -s  "https://cloud.joel.co.in" -u "[email protected]" -p "mypassword"
Name    ID
My Library d9d122233-43b6-4af3-21dde-59aawwwww45df11

Now download to local folder:

seaf-cli download -l "d9d122233-43b6-4af3-21dde-59aawwwww45df1" -s  "https://cloud.joel.co.in" -d /tmp/lib -u "[email protected]" -p "mypassword"
Starting to download ...
Library d9d122233-43b6-4af3-21dde-59aawwwww45df1 will be downloaded to /tmp/lib

Now add to this directory:

cp /tmp/att/* /tmp/lib/My\ Library/Shanghumukham-April\ 2017/Arun/

You dont need to upload/sync after adding files. The daemon automatically does that. In fact, if you attempt to sync you get an error:

seaf-cli sync -l "d9d122233-43b6-4af3-21dde-59aawwwww45df1" -s  "https://cloud.joel.co.in" -d /tmp/lib -u "[email protected]" -p "mypassword"
Starting to download ...
Traceback (most recent call last):
  File "/usr/bin/seaf-cli", line 832, in <module>
    main()
  File "/usr/bin/seaf-cli", line 828, in main
    args.func(args)
  File "/usr/bin/seaf-cli", line 568, in seaf_sync
    email, random_key, enc_version, more_info)
  File "/usr/lib/python2.7/dist-packages/pysearpc/client.py", line 112, in newfunc
    return fret(ret_str)
  File "/usr/lib/python2.7/dist-packages/pysearpc/client.py", line 25, in _fret_string
    raise SearpcError(dicts['err_msg'])
pysearpc.common.SearpcError: Repo already exists

It may be a good option to desync at the end lest you end up deleting needed folders/files.

Stopping sync:

seaf-cli desync -d /tmp/lib/My\ Library

Syncing to existing local library after desyncing:

seaf-cli sync -l "d9d122233-43b6-4af3-21dde-59aawwwww45df1" -d /root/SeafileLocalSync -s  "https://cloud.joel.co.in" -u "[email protected]"

More information from the Wiki:

Seafile client for a Cli server
Installation
You can follow this documentaion to install Seafile CLI client on various Linux distributions.

Basic Usage
Initialise & start the client

# choose a folder where to store the seafile client settings e.g ~/seafile-client
mkdir ~/seafile-client            # create the settings folder
seaf-cli init -d ~/seafile-client  # initialise seafile client with this folder
seaf-cli start
Download a library from a server

retrieve the library id by browsing on the server -> it's in the url after /repo/
then
seaf-cli download -l "the id of the library" -s  "the url + port of server" -d "the folder where the library folder will be downloaded" -u "username on server" [-p "password"]
seaf-cli status  # check status of ongoing downloads
# Name  Status  Progress
# Apps    downloading     9984/10367, 9216.1KB/s
Note: if you not supply the password parameter in the command, it will be asked later, which is more safe.

Example: `seaf-cli download -l 0536c006-8a43-449e-8718-39f12111620d -s http://cloud.seafile.com -d /tmp -u [email protected]`
Download a library from a server and sync with an existing folder.

# This is the same as download : replace download by sync 
seaf-cli sync -l "the id of the library" -s  "the url + port of server" -d "the folder where the library will be synced with" -u "username on server" -p "password"
Man documentation
seaf-cli is command line interface for seafile client.

Subcommands:

init                Initialize config directory
start               Start ccnet and seafile daemon
stop                Stop ccnet and seafile daemon
list                List local libraries
list-remote         List remote libraries
status              Show syncing status
download            Download a library from seafile server
download-by-name    Download a library defined by name from seafile server
sync                Sync a library with an existing foler
desync              Desync a library with seafile server
create              Create a library
config              Configure seafile client
Running seaf-cli -h will show the above help. For each subcommand, you can also use -h option to get help, e.g. seaf-cli download -h.

Detail
Seafile client stores all its configure information in a config dir. The default location is ~/.ccnet. All the commands below accept an option -c <config-dir>.

init
Initialize seafile client. This command initializes the config dir. It also creates sub-directories seafile-data and seafile under parent-dir. seafile-data is used to store internal data, while seafile is used as the default location put downloaded libraries.

seaf-cli init [-c <config-dir>] -d <parent-dir>
A file named seafile.ini will be created under ~/.ccnet to record the location of seafile-data directory.

If you want to run multiple instances of Seafile cli client in the same machine, you can specify different config-dir and parent-dir when initializing different client instances. Then the instances can run without interfering each others. When starting the instances, just specify ccnet config directories with the -c option.

start
Start seafile client. This command start ccnet and seaf-daemon, ccnet is the network part of seafile client, seaf-daemon manages the files.

seaf-cli start [-c <config-dir>]
stop
Stop seafile client.

seaf-cli stop [-c <config-dir>]
Download
Download a library from seafile server

seaf-cli download -l <library-id> -s <seahub-server-url> -d <parent-directory> -u <username> [-p <password>]
sync
Synchronize a library with an existing folder.

seaf-cli sync -l <library-id> -s <seahub-server-url> -d <existing-folder> -u <username> [-p <password>]
desync
Desynchronize a library from seafile server

seaf-cli desync -d <existing-folder>
create
Create a new library on server

seaf-cli create [-h] -n library-name -t description [-e library-password] -s server -u username -p password
Skip SSL certificate verify
If you're using self-signed certificate on the server, you should ask the client to skip verifying certificate.

seaf-cli config -k disable_verify_certificate -v true
Set Transfer Speed Limit
Set upload speed limit to 1MB/s :

seaf-cli config -k upload_limit -v 1000000
Set download speed limit to 1MB/s :

seaf-cli config -k download_limit -v 1000000

To sync your Dropbox folder to a new library in Seafile, create a library in Seafile named Dropbox. Then install Dropbox headless on the server and start the daemon:

64-bit:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

Next, run the Dropbox daemon from the newly created .dropbox-dist folder. You will need to authorize after starting the daemon:

~/.dropbox-dist/dropboxd
Dowload the Dropbox helper python script if you want fine grained control:
wget https://www.dropbox.com/download?dl=packages/dropbox.py
mv download\?dl\=packages%2Fdropbox.py dropbox.py
chmod +x dropbox.py
./dropbox.py

Now create a library in Seafile, note its library id (the sequence after /lib/)
Make seafile sync to existing Drobox directory

seaf-cli sync -l [libid] -s "https://cloud.yoursom.com" -u [Username] -d ~/Dropbox

To sync Google Drive:
First install the cli:
apt-get install git cmake build-essential libgcrypt11-dev libyajl-dev \
libboost-all-dev libcurl4-openssl-dev libexpat1-dev libcppunit-dev binutils-dev
git clone https://github.com/Grive/grive.git
cd grive
dpkg-buildpackage -j4 -uc -us
dpkg -i ../grive*deb
mkdir ~/GoogleDrive
cd ~/GoogleDrive
grive -a
seaf-cli sync -l [libid] -s “https://cloud.yoursom.com” -u [Username] -d ~/GoogleDrive
grive &
[/bash]

grive doesnt run as a daemon, so create a cron job to sync files every 5 minutes:

*/5 * * * * cd /root/GoogleDrive && /usr/bin/grive

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Install owncloud for own server (Simple method)

First create a virtual host, and go to that directory.
Install dependencies:

sudo apt-get install libapache2-mod-php5 php5-gd php5-json php5-mysql php5-curl php5-intl php5-mcrypt php5-imagick

Download and extract owncloud package (Find latest version here:

wget https://download.owncloud.org/community/owncloud-9.1.3.tar.bz2
tar xf owncloud-9.1.3.tar.bz2 && rm owncloud-9.1.3.tar.bz2
cd owncloud
mv * ../
mv .* ../

Now create a new database, a new user for that database and grant privileges for that user on that database. This can be done manually on the mysql command line or via phpmyadmin.

Go to the publicly accessible url and input these settings for a wizard install of owncloud.

If you want an ssl-only access to owncloud, first setup certificates on the server, and after verifying that the https:// url works fine, enter the following at the start of .htaccess file in the root of public web directory:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://cloud.yoursite.com/$1 [R,L]

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.
Merging pdf files

Merging pdf files

I’d like to talk about a nifty little utility that helps to combine multiple pdf files into one big file. Of course this is available in Adobe Acrobat Professional, but that’s a heavy weight and expensive software. If you’re good with Linux, you can try your luck with pdftk or ghostpdf. However those command line utilities require a good amount of technical knowhow and have a learning curve. If you use Windows, this small utility from A-PDF might just be your cuppa.

A-PDF Merger can be downloaded from A-PDF site. Once you install it, open it to get the following screen:

mwsnap001

Just drag all the required files and rearrange the order as you see fit. Once you click merge, the files are merged, and you get confirmation whether to open the output file. A-PDF Merger gives you a host of advanced options including a renumbering option and a bookmark addition for each file. A TOC option would have been a great addition. Maybe the authors will add it later.

Download A-PDF Merger and give it a try.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Download youtube video on the command line

The program you need is youtube-dl

Install youtube-dl:
Get the latest version install instructions here

Eg:

sudo curl https://yt-dl.org/downloads/2016.05.16/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

Update to latest version:

youtube-dl -U

Sometimes youtube blocks downloads.
Eg:
#youtube-dl -F https://www.youtube.com/watch?v=r3fhuJJRcYc
[youtube] r3fhuJJRcYc: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 429: Too Many Requests (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

In this case, your ip is being blocked by Google. Use tor to mask your ip:
#torify youtube-dl -F https://www.youtube.com/watch?v=r3fhuJJRcYc
[youtube] r3fhuJJRcYc: Downloading webpage
[youtube] r3fhuJJRcYc: Downloading video info webpage
[youtube] r3fhuJJRcYc: Extracting video information
[youtube] r3fhuJJRcYc: Downloading js player en_US-vflGdEImZ
[info] Available formats for r3fhuJJRcYc:
format code extension resolution note
249 webm audio only DASH audio 54k , opus @ 50k, 1.80MiB
250 webm audio only DASH audio 77k , opus @ 70k, 2.43MiB
140 m4a audio only DASH audio 128k , m4a_dash container, [email protected], 4.45MiB
251 webm audio only DASH audio 149k , opus @160k, 4.75MiB
171 webm audio only DASH audio 150k , [email protected], 4.55MiB
278 webm 256x144 144p 111k , webm container, vp9, 12fps, video only, 3.26MiB
160 mp4 256x144 144p 111k , avc1.4d400c, 24fps, video only, 3.84MiB
133 mp4 426x240 240p 252k , avc1.4d4015, 24fps, video only, 8.62MiB
242 webm 426x240 240p 256k , vp9, 24fps, video only, 7.19MiB
243 webm 640x360 360p 472k , vp9, 24fps, video only, 13.00MiB
134 mp4 640x360 360p 638k , avc1.4d401e, 24fps, video only, 13.03MiB
244 webm 854x480 480p 822k , vp9, 24fps, video only, 22.17MiB
135 mp4 854x480 480p 1166k , avc1.4d401e, 24fps, video only, 25.19MiB
247 webm 1280x720 720p 1566k , vp9, 24fps, video only, 41.77MiB
136 mp4 1280x720 720p 2288k , avc1.4d401f, 24fps, video only, 44.77MiB
248 webm 1920x1080 1080p 2715k , vp9, 24fps, video only, 73.14MiB
137 mp4 1920x1080 1080p 3726k , avc1.640028, 24fps, video only, 77.35MiB
17 3gp 176x144 small , mp4v.20.3, mp4a.40.2@ 24k
36 3gp 320x180 small , mp4v.20.3, mp4a.40.2
5 flv 426x240 small , h263, mp3 @ 64k
43 webm 640x360 medium , vp8.0, [email protected]
18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k
22 mp4 1280x720 hd720 , avc1.64001F, [email protected] (best)

Downloading mp3 songs from youtube video:

torify youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=APJxwxZuA0E

Use a bash alias to simplify the process:

alias ymp3='torify youtube-dl --extract-audio --audio-format mp3'
ymp3 https://www.youtube.com/watch?v=Qs2ta9_CaKM

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Changing gnome settings in Ubuntu 16.04 from command line

You can get a list of schemas with:

gsettings list-schemas
org.gnome.rhythmbox.library
org.gnome.shell.overrides
org.gnome.system.proxy.https
org.nemo.preferences
org.gnome.settings-daemon.plugins.cursor
org.gnome.evolution.shell
org.gnome.evolution.plugin.face-picture
com.ubuntu.update-manager
org.gnome.shell.extensions.auto-move-windows
org.gnome.eog.fullscreen
org.gnome.login-screen
org.gnome.eog.view
org.gnome.evolution-data-server.calendar
org.gnome.evolution.plugin.itip
org.gnome.evolution.plugin.autocontacts
org.gnome.evolution.plugin.attachment-reminder
com.canonical.a11y-profile-manager
org.gnome.libgnomekbd
org.gnome.rhythmbox.plugins.mtpdevice
org.gnome.desktop.search-providers
org.gnome.evolution.shell.network-config
org.gnome.Logs
org.gnome.rhythmbox.player
org.gnome.calculator
org.gnome.settings-daemon.plugins.a11y-settings
org.gnome.DejaDup.Rackspace
org.gnome.system.smb
org.gnome.desktop.media-handling
org.gnome.software
org.gnome.settings-daemon.plugins.smartcard
org.freedesktop.Telepathy.Logger
org.gnome.desktop.default-applications
org.gnome.nm-applet
org.gnome.settings-daemon.peripherals.keyboard
org.gnome.gnome-system-log
org.gnome.evolution
org.gnome.settings-daemon.plugins
org.gnome.Terminal.ProfilesList
org.gnome.shell.app-switcher
com.canonical.unity-gtk-module
org.freedesktop.Tracker
org.gnome.Contacts
org.gnome.gedit.state
org.gnome.gedit.preferences.ui
org.gnome.rhythmbox.plugins.magnatune
org.gnome.documents
org.gnome.FileRoller.Dialogs.New
org.gnome.gedit.plugins
org.gnome.settings-daemon.plugins.gsdwacom
org.gnome.desktop.a11y.mouse
org.gtk.Settings.Debug
org.gnome.shell.extensions.screenshot-window-sizer
org.gnome.desktop.wm.preferences
org.gnome.seahorse.recipients
org.gnome.gedit.state.history-entry
org.gnome.online-accounts
org.gnome.mutter.keybindings
org.gnome.settings-daemon.plugins.xsettings
org.gnome.FileRoller.Dialogs.LastOutput
org.gnome.Empathy.conversation
org.gnome.nautilus.window-state
org.gnome.gedit.plugins.terminal
org.gnome.yelp
org.gnome.libgnomekbd.keyboard
org.gnome.gnome-screenshot
org.nemo.privacy
org.gnome.DejaDup.GDrive
org.gnome.evolution.plugin.prefer-plain
org.gnome.shell.window-switcher
com.ubuntu.notifications.hub
org.gnome.seahorse
org.gnome.settings-daemon.plugins.media-keys
org.gnome.totem.plugins.opensubtitles
org.gnome.Empathy.sounds
org.gnome.settings-daemon.plugins.color
org.gnome.evolution-data-server
org.gnome.totem
org.gnome.baobab.preferences
org.nemo.icon-view
org.gnome.FileRoller.Dialogs.Add
org.gnome.settings-daemon.plugins.gdu-sd
org.gnome.evolution.plugin.publish-calendar
org.freedesktop.ibus.general.xkblayoutconfig
org.gnome.settings-daemon.plugins.xrandr
org.gnome.baobab.ui
org.gnome.shell.extensions.classic-overrides
org.gnome.desktop.a11y.keyboard
org.gnome.settings-daemon.plugins.orientation
org.gnome.desktop.a11y
org.gnome.system.proxy.socks
org.gnome.desktop.interface
org.freedesktop.Tracker.FTS
org.gnome.system.proxy
org.gnome.mousetweaks
org.gnome.gedit.preferences
org.gnome.desktop.lockdown
org.gnome.settings-daemon.plugins.housekeeping
org.gnome.Empathy.notifications
org.gnome.desktop.a11y.applications
org.gnome.mutter.wayland.keybindings
org.gnome.rhythmbox.sources
org.gnome.settings-daemon.plugins.rfkill
org.gnome.gedit.preferences.print
org.gnome.evolution.spamassassin
org.freedesktop.Tracker.Miner.Files
org.gnome.Maps
org.gnome.settings-daemon.plugins.datetime
org.nemo.sidebar-panels.tree
org.gnome.Evince.Default
org.gnome.rhythmbox
org.gnome.settings-daemon.plugins.clipboard
org.gnome.libgnomekbd.preview
org.gnome.desktop.default-applications.office.calendar
org.gnome.mines
org.gnome.shell
org.gnome.Empathy.hints
org.gnome.Terminal.Legacy.Settings
org.gnome.brasero.config
org.gnome.desktop.screensaver
org.gnome.eog.plugins
org.gnome.system.locale
org.gnome.settings-daemon.plugins.updates
org.gnome.desktop.wm.keybindings
org.gnome.eog
org.gnome.system.proxy.ftp
org.gnome.evolution.addressbook
org.gnome.sudoku
org.gnome.gedit
org.gnome.Disks
org.freedesktop.Tracker.DB
apps.nautilus-pastebin
org.freedesktop.Tracker.Needle
org.gnome.evolution.bogofilter
org.gnome.mutter
org.freedesktop.folks
org.gnome.gedit.preferences.encodings
org.gnome.evolution.importer
org.gnome.FileRoller.Listing
org.freedesktop.Tracker.Writeback
org.gnome.gnome-system-monitor
org.gnome.system.proxy.http
org.gnome.SessionManager
org.gnome.gedit.state.window
org.nemo.desktop
org.nemo.list-view
org.gnome.desktop.background
org.freedesktop.ibus.general
org.gnome.Evince
org.gnome.Empathy.ui
org.gnome.baobab
org.gnome.evolution.calendar
org.gnome.brasero
org.gnome.settings-daemon.peripherals
org.gnome.desktop.peripherals
com.ubuntu.user-interface
ca.desrt.dconf-editor.Settings
com.canonical.indicator.sound
org.gnome.desktop.notifications
org.gnome.gedit.plugins.time
org.gnome.gedit.plugins.filebrowser.nautilus
org.gnome.Empathy.location
org.gnome.Charmap
org.gnome.FileRoller
org.gnome.Weather.Application
org.gnome.Cheese
org.gnome.gedit.plugins.filebrowser
com.ubuntu.sound
org.gnome.desktop.peripherals.mouse
org.gnome.crypto.pgp
org.gnome.FileRoller.General
org.gnome.GWeather
org.gnome.settings-daemon.plugins.screensaver-proxy
org.gnome.desktop.default-applications.office.tasks
org.gnome.Empathy.call
org.gnome.books
org.gnome.desktop.app-folders
org.gnome.gedit.preferences.editor
org.gnome.settings-daemon.peripherals.smartcard
org.gnome.gnome-system-monitor.openfilestree
org.gnome.nautilus.list-view
org.gnome.SimpleScan
org.gnome.nautilus.icon-view
org.nemo.compact-view
org.gnome.rhythmbox.plugins.iradio
org.gnome.desktop.peripherals.touchpad
org.gnome.gnome-system-monitor.memmapstree
org.gnome.DejaDup.File
org.gnome.Music
org.gnome.seahorse.manager
org.gnome.evolution.plugin.external-editor
org.gtk.Settings.FileChooser
com.ubuntu.touch.sound
org.gnome.DejaDup.S3
org.gnome.settings-daemon.plugins.remote-display
org.gnome.shell.keyboard
org.gnome.libgnomekbd.desktop
org.gnome.shell.extensions.user-theme
org.gnome.calendar
org.gnome.gedit.state.file-filter
org.gnome.mahjongg
org.gnome.shell.calendar
org.gnome.settings-daemon.plugins.background
org.freedesktop.Tracker.Miner
org.gnome.settings-daemon.plugins.a11y-keyboard
org.gnome.Charmap.WindowState
org.gnome.telepathy-account-widgets.ui
org.gnome.rhythmbox.plugins.visualizer
org.gnome.settings-daemon.peripherals.input-devices
org.freedesktop.Tracker.Store
org.gtk.Settings.ColorChooser
org.gnome.desktop.privacy
org.gnome.system.dns_sd
org.freedesktop.ColorHelper
org.gnome.rhythmbox.plugins.grilo
org.gnome.desktop.a11y.magnifier
org.gnome.seahorse.nautilus
org.gnome.rhythmbox.plugins.replaygain
org.gnome.rhythmbox.plugins.ipod
org.gnome.rhythmbox.plugins.daap
org.gnome.desktop.default-applications.office
org.gnome.rhythmbox.rhythmdb
org.gnome.desktop.sound
org.gnome.evolution.mail
org.gnome.desktop.datetime
org.gnome.Vino
com.ubuntu.touch.network
org.gnome.rhythmbox.podcast
org.gnome.evolution-data-server.addressbook
org.gnome.evolution.plugin.templates
org.gnome.evolution.plugin.mail-notification
org.gnome.desktop.peripherals.keyboard
org.gnome.settings-daemon.plugins.mouse
org.gnome.settings-daemon.plugins.sharing
org.gnome.crypto.cache
org.gnome.rhythmbox.plugins.audiocd
org.gnome.gedit.plugins.pythonconsole
org.freedesktop.ibus.panel
org.gnome.photos
com.ubuntu.phone
com.ubuntu.touch.system
org.gnome.FileRoller.UI
org.gnome.FileRoller.Dialogs.Extract
org.gnome.FileRoller.Dialogs
org.gnome.desktop.input-sources
org.gnome.Evolution.DefaultSources
org.gnome.desktop.default-applications.terminal
org.gnome.eog.ui
org.gnome.rhythmbox.plugins.android
org.gnome.system.location
org.gnome.rhythmbox.plugins
org.gnome.shell.keybindings
org.nemo.sidebar-panels
org.gnome.libgnomekbd.indicator
org.gnome.FileRoller.FileSelector
org.gnome.settings-daemon.plugins.sound
org.gnome.settings-daemon.plugins.power
apps.gtkhash
apps.gtkhash-properties
org.nemo.window-state
com.canonical.indicator.appmenu
org.gnome.settings-daemon.plugins.keyboard
org.nemo.plugins
org.freedesktop.ibus
org.gnome.rhythmbox.sharing
org.gnome.brasero.display
org.nemo
org.gnome.desktop.session
org.gnome.settings-daemon.peripherals.touchscreen
org.freedesktop.gstreamer-0.10.default-elements
org.gnome.gnome-system-monitor.proctree
com.ubuntu.update-notifier
org.gnome.nautilus
org.gnome.desktop.peripherals.trackball
org.gnome.meld
org.gnome.evolution.eds-shell
org.freedesktop.ibus.general.hotkey
org.gnome.desktop.thumbnail-cache
org.gnome.desktop.thumbnailers
com.canonical.Unity.Lenses
org.gnome.gedit.plugins.externaltools
org.gnome.nautilus.preferences
org.gnome.gnome-system-monitor.disktreenew
im.telepathy.MissionControl.FromEmpathy
org.gnome.brasero.filter
com.canonical.indicator.messages
org.gnome.DejaDup.OpenStack
org.gnome.gedit.plugins.drawspaces
org.freedesktop.Geoclue
org.gnome.desktop.file-sharing
org.gnome.shell.extensions.native-window-placement
org.gnome.DejaDup.GCS
org.gnome.DejaDup
org.gnome.rhythmbox.plugins.lyrics
org.gnome.settings-daemon.peripherals.mouse
org.gnome.rhythmbox.plugins.generic-player
org.gnome.evolution.plugin.email-custom-header
org.gnome.gedit.plugins.wordcompletion
org.freedesktop.Tracker.Extract
org.gnome.shell.extensions.window-list
org.gnome.settings-daemon.plugins.print-notifications
org.gnome.totem.plugins.pythonconsole
org.gnome.Empathy
org.gnome.nautilus.desktop

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Unable to send email to an external mail server whose domain is configured in domain

I was facing a peculiar issue where I need to send mail to [email protected] eyrie.in was one of the virtual servers enabled in Virtualmin. So when I tested email from command line (mutt/postfix), I got this in /var/log/mail.info:

tac /var/log/mail.info | less:
May 6 07:49:55 server postfix/bounce[19314]: 26C8F41C45: sender non-delivery notification: 4D37341CD0
May 6 07:49:55 server postfix/cleanup[19312]: 4D37341CD0: message-id=<[email protected]>
May 6 07:49:55 server postfix/error[19313]: 26C8F41C45: to=, relay=none, delay=0.22, delays=0.14/0.01/0/0.07, dsn=5.1.1, status=bounced (User unknown in virtual alias table)
May 6 07:49:55 server postfix/qmgr[19274]: 26C8F41C45: from=, size=802, nrcpt=1 (queue active)

After a variety of tests, I found that the reason was because virtualmin enabled user aliases lists for all domains configured in it. There was an option hidden in to disable mail for those domains from within virtualmin. So go here:

Virtualmin > Domain > Edit virtualserver > Enabled features
Untick the following:
Mail for domain enabled?
Virus filtering enabled?
Spam filtering enabled?

Unless the latter two are disabled, you wont be able to disable mail for that domain. Once this is done, reload postfix with:

/etc/init.d/postfix reload

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Managing printers from the command line

Get a list of printers:

# lpstat -p -d
printer DCP7060D is idle.  enabled since Sunday 27 September 2015 11:13:03 PM IST
printer RICOH-SP-111-DDST is idle.  enabled since Sunday 27 September 2015 10:18:49 PM IST
system default destination: RICOH-SP-111-DDST

Print to a specific printer:

lp -d printer filename

Example:

# lp -d DCP7060D moddriver.txt
request id is DCP7060D-1 (1 file(s))

Set a default printer:

lpoptions -d printer

You can get a complete list of options from the help available on localhost


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Use tor for any command on Linux

The following details a procedure to use tor for any commands used on the command line in Linux. The test env here is a Debian server.

Install tor:

# apt-get install tor

You should create a hashed control password for tor:

#tor --hash-password 'mypassword'
Apr 22 21:00:14.198 [notice] Tor v0.2.4.27 (git-412e3f7dc9c6c01a) running on Linux with Libevent 2.0.19-stable and OpenSSL 1.0.1e.
Apr 22 21:00:14.198 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Apr 22 21:00:14.206 [warn] You are running Tor as root. You don't need to, and you probably shouldn't.
16:A08B4CD129C38494608095E8CB6E3CF6FD61987221130F81E49F28783D

Now setup tor options in the control file at /etc/tor/torrc so that it contains the following:

ControlPort 9051
CookieAuthentication 0
HashedControlPassword 16:A08B4CD129C38494608095E8CB6E3CF6FD61987221130F81E49F28783D

Now, Restart the tor service:

service tor restart

Test the current ip:
# curl ifconfig.me 2>/dev/null
196.152.33.228

Now test the torrized ip:

# torify curl ifconfig.me 2>/dev/null
162.247.72.212

To get a new ip, do this:

echo -e 'AUTHENTICATE "mypassword"\r\nsignal NEWNYM\r\nQUIT' | nc 127.0.0.1 9051

Here, you’re providing the password which you created earlier.

Test the new ip:

# torify curl ifconfig.me 2>/dev/null
77.109.141.138

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.