Setting up email with Webmin/Virtualmin

First create a user account (or use a builtin account):
Virtualmin>Edit users:
Add a user:
Email address: [email protected]
POP3 login username is automatically chosen for you. Set the password.
You can test mail sending by logging in at the webmail interface at https://gody.com:20000/?mail

Next add a mail server record:
Webmin>Servers>Bind DNS Servers>
Choose your domain by clicking on it:
Name is the website name typically.
Eg: I want to send mail to [email protected], fill in the following details:
Name gody.com
Mail Server: mail.gody.com
TTL: Default
Priority: 5

Now go to your DNS registrar (Eg Cloudflare) and setup the following records:
Add an MX record.
Name: gody.com
Value: mail.gody.com
TTL 2 minutes

Now test your settings in a POP3 program like Outlook:
Account type: POP3
Incoming mail server: mail.gody.com
Outgoing mail server: mail.gody.com
Username: joel.gody
Password: What you chose.


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

Remove highlighting and comments from a PDF file

In Acrobat Pro (I’m using Adobe Acrobat Pro DC), Tools>Action wizard>New action>More tools>Execute javascript>Specify settings>Create and edit JS:

Add the following code:

/* Remove Highlighting only */
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i=annots.length-1; i>=0; i--) {
if (annots[i].type=="Highlight")
annots[i].destroy();
}
}

or if you want to remove both highlighting and comments:

/* Remove Highlighting and Comments */
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i=annots.length-1; i>=0; i--) {
annots[i].destroy();
}
}

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

Install nodejs on Debian

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

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

How to arrange an A3 sheet with passport size photos with cutting marks

Steps:
Create a Coreldraw (X8 will be used here) .cdr document with the correct dimensions. Here, I’ll be using 18.9×12.4 inches.
Create a rectangle of size 35mmx45mm.
Use the contour tool to insert an inner contour of 2mm
Contour>2mm
Object>Break contour group apart (Ctrl-K)
In Color palette, right click on X for inner rectangle to have no color border
Click on imported pic, Obj>Powerclip>Place inside frame, click on inner frame
Object Powerclip>Edit powerclip
Resize and arrange photo so it the cropped image would fit as necessary
Make a straight line of 6mm, Copy and paste a copy at the same place
Rotate the copy by 90 degree, so that it creates a cross hair.
Group the photo frame back
Make a copy the crosshairs, select them along with the photo frame.
Click on B,R;
Repeat with a copy of crosshairs, select with the photoframe, B, L;
Repeat with a copy of crosshairs, select with the photoframe,T, L
Repeat with a copy of crosshairs, select with the photoframe,T,R
Group the photo with the cutting mark, drag and position
Object>Transformation>Position
Create as many copies as needed to fill the sheet.


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

Compile and install nemo file manager on nemo in Ubuntu Xenial.

git clone https://github.com/linuxmint/nemo
cd nemo/
./configure && make && make install

If it throws the following error:

./autogen.sh: 25: ./autogen.sh: aclocal: not found

, do:

sudo apt-get install automake gtk-doc-tools gobject-introspection libgtk-3-dev libgail-3-dev libcinnamon-desktop-dev libxml2-dev libnotify-dev libexif-dev libexempi-dev

I also had to manually installer older version packages for “tracker support” because it was not recognizing the newer version that came with Ubuntu Xenial:

wget http://security.ubuntu.com/ubuntu/pool/universe/t/tracker/libtracker-sparql-0.16-0_0.16.5-0ubuntu0.2_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/t/tracker/libtracker-miner-0.16-0_0.16.5-0ubuntu0.2_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/t/tracker/gir1.2-tracker-0.16_0.16.5-0ubuntu0.2_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/t/tracker/libtracker-sparql-0.16-dev_0.16.5-0ubuntu0.2_amd64.deb
sudo dpkg -i *deb
sudo apt-get install -f 

After doing all this I was getting a compiler error:

Makefile:780: recipe for target 'eel-canvas.lo' failed

So I had to pass a flag to ./configure to suppress the error:

/configure --disable-Werror

Next:

make && sudo make install

Now create a shortcut in the menu for Nemo:

cp data/nemo.desktop ~/.local/share/applications/

Now you can launch it by typing “Files” in the menu. If you want to change the name, edit ~/.local/share/applications/nemo.desktop.

[Desktop Entry]
Name=Nemo
Name[en_GB]=Files
Comment=Access and organize files
Exec=nemo %U
Icon=folder
Terminal=false
Type=Application
StartupNotify=false
Categories=GNOME;GTK;Utility;Core;
MimeType=inode/directory;application/x-gnome-saved-search;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=nemo
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.2.2

I submitted an issue on github.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.
Set Firefox as default browser on Windows 10

Set Firefox as default browser on Windows 10

Mozilla recommends launching the Windows wizard from Options>Set Firefox as default, which launches the Windows settings dialog, which..wait for it..does not even show Firefox in its list:

I tried to bring up the “Set defaults by app”, but again, no Firefox in the list! It appears that the Settings>Choose defaults thing is seriously botched.
However after a lot of hair pulling, to my surprise, I found another place to set Firefox as default. It appears that while integrating Windows 8 and 7 like features into Windows 10, Microsoft has duplicated this option, and the proper place to do this is to just type the following into the addressbar of Explorer:

Control Panel\All Control Panel Items\Default Programs\Set Default Programs

Within that Window, in one click, Firefox can be set as default. Actually this is the same settings screen that shipped with Windows 8 and 8.1 and works just fine:


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

Install composer on Debian

Run:

sudo apt-get install curl php5-cli
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Test it:

$composer -V
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Composer version 1.3.0 2016-12-24 00:47:03

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

Building and using opticons

Now that glyphicons have been phased out in Bootstrap 4, I needed an alternative and found opticons.

To install it:
First install Node Package Manager (npm):

curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
apt-get install nodejs
wget https://github.com/primer/octicons/archive/v5.0.1.zip
unzip v5.0.1.zip
cd octicons-5.0.1/

Now we need to edit the json to prevent npm from aborting saying that opticons cant be installed as a dependency of itself.
emacs package.json
Change the line:

"name": "octicons",

To

"name": "octicons-test",

Now continue:
npm install octicons –save
npm run build

Now the required files are available at ./build/


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

Need to press SPACE key after entering single or double quote characters

After installing Windows on a new HP laptop, I started noticing that the keyboard required me to press SPACE after typing quote characters, for them to become visible.

Fix: This happens because your keyboard is currently set to United States-International keyboard. Change it to something else and the keys work as intended.

Source: http://superuser.com/a/800064/133233


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

Error restarting apache2 after server upgrade

AH00526: Syntax error on line 2 of /etc/apache2/sites-enabled/cp2.joel.co.in.conf:
Invalid command 'SuexecUserGroup', perhaps misspelled or defined by a module not included in the server configuration

Fix:

a2enmod suexec
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Fix:

a2enmod rewrite
AH00526: Syntax error on line 89 of /etc/apache2/apache2.conf:
Invalid command 'LockFile', perhaps misspelled or defined by a module not included in the server configuration

Fix:
Replace the line in /etc/apache2/apache2.conf:

LockFile ${APACHE_LOCK_DIR}/accept.lock

By:

Mutex file:${APACHE_LOCK_DIR} default
[....] Restarting web server: apache2AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ks4.droidzone.in. Set the 'ServerName' directive globally to suppress this message

Fix:
Add the following line to the end of /etc/apache2/apache2.conf:

ServerName localhost

Restart apache after the fixes.


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