Azitech

Azimout's Linux weblog

Archive for the ‘Howto’ Category

Connect to WPA2 wifi from Linux server

leave a comment »

If you have a terminal-only, no-GUI linux server that you need to connect to a WPA2 PSK network, here’s what you need to add to /etc/network/interfaces:

auto wlan0

iface wlan0 inet dhcp

wpa-ssid {myssid}

wpa-psk {mywpapsk}

dns-nameservers 8.8.8.8

To calculate your 256-bit WPA PSK from your ASCII passphrase, run the following command:

wpa_passphrase ssid passphrase

Be warned, the result is 32 characters long.

Written by azimout

28/01/2015 at 20:20

Posted in Howto

Migrating from one Google account to another

leave a comment »

Here’s the steps I followed and difficulties I recently encountered while migrating from one Google account to another:

Emails

You need to enable POP3 on the source account and then have the target account import them. This can take several hours days if (like me) you have accumulated many thousands of emails over several years. It will import all past email and then continue to import email arriving at the source account in the future.

One issue is that you lose the labels structure you had assigned to emails in the source Gmail account.

If you have enabled 2-step authentication on the source account (as you should), you’ll need to create an “application specific password” to give to the target Gmail account.

You’ll then have to change all your newsletter and mailing list subscriptions to point to the new address, and let all your contacts know that they should from now on contact you at your new address.

Contacts

This one is totally straightforward; you export to a CSV file and import on the new account. All info is maintained, including groups.

Calendars

Export all calendars into a ZIP file containing one iCal file per calendar. Create calendars on target account, import iCal files one-by one.

If you shared any of them with other users, you’ll need to share them again; in that case, tell the other users to remove the old instance of each shared calendar, otherwise they’ll see duplicate events.

If other users shared calendars with you, they’ll need to share them again.

Drive

Unfortunately, the only way seems to be to download everything, and then upload it again on the target account.

Google+

Profile: you’ll need to re-introduce this.

Photos: use Google Takeout to download them, then upload them again

Circles/People: Use Google Takeout, as described here

Posts: I haven’t found a way to migrate those.

Maps

Re-introduce your starred places manually.

Youtube

Video Uploads: if you no longer have the originals, download each from Video Manager. Then upload each video anew.

Subscriptions: there seems to be no way to export your subscriptions. Just subscribe again, one-by-one.

Playlists, liked/favourite videos: Lists have to be public or unlisted, not private. Share them with yourself via email, then save them in your new profile.

Chrome Sync

Just sign out of the old account and sign into the new one. Bookmarks, passwords etc will remain in the browser when you sign out of the old account, and will then be imported into the new account when you sign into it.

Play Store

It is not possible to transfer purchased apps to another account.

Keep

You’ll need to reintroduce each note. You can email  to yourself the larger ones

Written by azimout

21/10/2014 at 18:05

Posted in Howto

Installing Epson Stylus SX424W under Linux

leave a comment »

Out of the box, if you tell Ubuntu to add a network printer, it will find it (give it 5-10 seconds to search) and recognise its make and model. However, if you press proceed, it will get stuck searching for the driver.

The solution is to go to download.ebz.epson.net/dsc/search/01/search/?OSC=LX and search not for SX424W, but for SX420. Then download the correct driver for your system (.rpm or .deb, x86 or x64) and install it. There’s one driver for the printer and another one for the scanner.

After that, repeat the “add network printer” wizard.

Written by azimout

29/08/2014 at 07:39

Posted in Howto

Rotate videos from the command line

leave a comment »

To rotate a video from the command line, use avconv (contained in the libav-tools package), which used to be called ffmpeg.

For a single file, type:

avconv -i original.mp4 -vf "transpose=1" rotated.mp4

Written by azimout

10/02/2014 at 09:45

Posted in Howto

Nagios

with 2 comments

Here’s how you can set up a Nagios server in order to monitor a publicly accessible website and get an email notification when it’s down.

On the monitoring server:

Now create a .cfg file under /etc/nagios3/conf.d with the following contents:

define host {
        use             generic-host
        host_name       xxx
        alias           xxx
        address         xxx
        }
define service {
        use             generic-service
        host_name       xxx
        service_description     HTTP
        check_command   check_http
        }

(replace all instances of xxx with the appropriate values)

Now restart Nagios: sudo service nagios3 restart

Any notifications will be emailed to root@localhost

References:

Written by azimout

22/09/2013 at 20:06

Posted in Howto

How to install request tracker in Ubuntu

leave a comment »

  • sudo apt-get install request-tracker4 rt4-db-mysql rt4-apache2 libapache2-mod-fcgid
  • sudo cp /etc/request-tracker4/apache2-fcgid.conf /etc/apache2/sites-available/rt4
  • sudo a2ensite rt4; sudo service apache2 restart

To edit RT’s configuration, don’t edit directly the file /etc/request-tracker4/RT_SiteConfig.pm. Instead, change the files (or add one) under /etc/request-tracker4/RT_SiteConfig.d/*, then run sudo update-rt-siteconfig

Written by azimout

03/07/2013 at 10:17

Posted in Howto

Submenus in Drupal with Superfish

leave a comment »

If your Drupal theme does not support submenus, you will not see them even if you add them to your menu, enable them and activate the “show as expanded” option on the parent menu item.

The solution is Superfish (based on the jQuery Superfish plugin). In order to install it in Drupal, do the following:

Now go to your Drupal administration interface, find Superfish under modules and configure the number of menu blocks you want it to add. I set it to one as that’s all I need.

Then, go to Structure – Blocks, disable the Main Menu, enable your Superfish menu and click on “configure” next to it, then set its title to <none> and menu parent as the main menu.

Written by azimout

21/03/2013 at 21:46

Posted in Howto

drush

leave a comment »

A very useful command-line tool for Drupal is Drush

I use it to update Drupal modules, themes and the Drupal core, plus it automatically does backups before each operation, and database upgrades when needed afterwards.

Here’s how to install drush:

sudo apt-get install php-pear
sudo pear channel-discover pear.drush.org
sudo pear install drush/drush

Then to update a given module, cd to the base of your Drupal installation and run

sudo drush up <module name>

Written by azimout

10/03/2013 at 15:56

Posted in Howto

IRC with Empathy on Ubuntu

leave a comment »

If you want to chat on IRC using the Empathy client in Ubuntu, you need to install the following two packages: telepathy-idle account-plugin-irc

For more info: https://help.ubuntu.com/community/InternetRelayChat

Written by azimout

26/02/2013 at 22:35

Posted in Howto

Free your Android

with one comment

Here is a step-by-step guide to install CyanogenMod (CM) 10.1 on your Galaxy SIII (i9300) from a Ubuntu 12.10 amd64 system. It adds some clarifications and some additional advice to the official guide on cyanogenmod.org.

It’s best to have a microSD card where you can put the image files and perform backups.

Downloads

Before you start messing with your phone, download all the tools and images you need:

  • the Heimdall tool and the ClockworkMod Recovery .img file (CWM) that corresponds to your phone
  • the CM prebuilt release of your choice (.zip); I went with the latest CM 10.1 Nightly in order to have all the latest features
  • optional: the non-FOSS Google apps (Play Store, Maps, etc), as they are not included in the stock CyanogenMod ROM

Now put the CM and Google Apps images onto the microSD and plug it into your phone.

ClockworkMod Recovery

In this section you will replace Android’s default recovery mode with the ClockworkMod one, which has some additional features

To enter Download Mode, shut down your Galaxy and then press simultaneously the Power, Home and Volume Down buttons for 2-3 seconds; at the warning, press Volume Up to continue

  1. put your phone into Download Mode
  2. connect the phone via USB cable to your PC
  3. in a terminal on your PC, run: sudo heimdall flash --recovery <recovery file> --no-reboot

The heimdall tool should install the CWM recovery on your phone and then wait. If a blue progress bar appeared on your phone, proceed to the next section. Do not reboot your phone yet.

Install CyanogenMod

In this section you will backup your phone, wipe it and install CyanogenMod (CM) and the Google Apps.

To enter Recovery Mode, shut down your Galaxy and then press simultaneously the Power, Home and Volume Up buttons until you see the “Samsung Galaxy S III” logo; then release the Power button while still pressing the Home and Volume Up buttons

  1. reboot the phone into Recovery Mode (Attention! Don’t let your phone boot normally, or you’ll need to re-install CWM)
  2. move up and down in the menu with the volume keys and make a choice with the power button
  3. before you do anything else, perform a backup; it will backup your /boot, /recovery, /system, /data and /cache
  4. wipe the /data and /cache partitions
  5. choose “Install zip from sdcard”, then “choose zip from external sdcard” and choose first the CM image, then the Google Apps image
  6. reboot your phone by choosing “+++++Go Back+++++” and then “reboot system now”

Your phone should boot into the new operating system.

If you see the CyanogenMod logo rotate for more than 5′, something is wrong. Repeat the above steps

Once you connect with your Google account and open the Play Store, it should start downloading all the apps you had on Android. However, you will need to add all accounts once again.

Now that you have rooted your phone, you might want to install SuperUser and  Rom Manager.

Written by azimout

23/02/2013 at 11:49

Posted in Howto