Shell script for volume control

The base of the Linux sound software stack is formed by ALSA, the Advanced Linux Sound Architecture, with these days normally a midlevel layer on top in the form of Pulseaudio; you can arrange for volume adjustment at both levels; should preferably do so at the Pulseaudio one.

Pulseaudio makes available the pactl tool, which you can use in the form of, say,

pactl set-sink-volume 0 0
pactl set-sink-volume 0 50%
pactl set-sink-volume 0 +10%
pactl set-sink-volume 0 -10%

In Mint 17.3 pactl has a bug that necessitates writing that last example as pactl -- set-sink-volume 0 -10% instead; would not know if the Mint 18 version still has the issue; see https://bugs.freedesktop.org/show_bug.cgi?id=77108. The first 0 in those commands specifies the sink, the sound card, and is automatically correct if you have only one card installed. Otherwise decide which sink to use from the output of pactl list sinks. Use man pactl for further information.

At the ALSA level you have available the amixer command line mixer. For example,

amixer set Master 0
amixer set Master 50%
amixer set Master 10%+
amixer set Master 10%-

In this, not specifying a card number with -c <number> means card 0; if not, use aplay -l to identify the number. “Master” is the name of a generally available control; you can list available controls with amixer scontrols and learn more from man amixer.

If you are not specifying correct sink for pactl or card/device/control for amixer please see your outputs of pactl list sinks and aplay -l.

Notepad++ on Linux

Notepad++ is one of the popular code editors and the fact that most of the users run Windows, it is available for Windows only. Some Linux users have surely missed it. Good news is that Notepad++ is now (unofficially) available as a Snap package for Linux user. Though this Notepad++ Linux application is not natively developed for Linux platform and actually runs on Wine, it’s now a command (or click) away for you.

Read More

Removing EXIF Data From Images and Photos

Most digital cameras and cell phone add EXIF metadata to the images.
If you’re worried about the privacy, you may want to anonymize your images and photos by removing all the EXIF metadata.
In this small guide, i’ll show how to read and then remove all EXIF metadata, using Linux command line utility, named ExifTool. Read More

Enable innodb_file_per_table

innodb_file_per_table is by default ON Mysql 5.6.6 and onwards. There is plenty of stuff on Google about pros & cons ofinnodb_file_per_table.
This post details how to enable innodb_file_per_table on an existing database. Because innodb_file_per_table affects new tables only, created after innodb_file_per_table is enabled, we need to recreate old databases to force innodb_file_per_table on old tables and reclaim some disk space.

Backup First

Create a dir to take backups:

cd ~
mkdir backup
cd backup

Read More

Method to install Grub Customizer [Ubuntu/Elementary]


I fresh install of win10 and elementary OS, want customizer. My PC is booting into elementary by default instead of into win10. I use both, but I want o boot into win10 by default. This is method to install Grub Customizer in Loki (maybe in other Ubuntu/Debian Linux OS).

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
grub-customizer

Read More

How to Keep Alive SSH Sessions

Many NAT firewalls time out idle sessions after a certain period of time to keep their trunks clean. Sometimes the interval between session drops is 24 hours, but on many commodity firewalls, connections are killed after as little as 300 seconds. To avoid having your SSH sessions become unresponsive after e.g. 5 minutes, do the following:
Read More