Recently, I wanted to read some documents (i.e. from Google Docs) on my Kindle. I was interested in exporting .mobi, as reading PDFs on Kindle is really annoying.
I found converting .doc into .mobi not a trivial task. Luckily, nearly everything is possible in Ubuntu with a few steps:
- Download your document as .doc / .docx
- Open .doc / docx in LibreOffice / OpenOffice and export to ePub (you’ll need to install Writer2ePub before)
- Import ePub into Calibre and export it to your favourite eBook reader.
Inspired by Quora.
After rather successful year of using WordPress, I have decided to move my blog to AWS. I was considering the move for long time, motivated by Free Tier and finally I found some time to do it.
At first, I have created WordPress Stack using CloudFormation, but personally I prefer Ubuntu over Amazon Linux and I will focus on configuration of Ubuntu EC2 instance here.
- Export your existing blog
WP-Admin > Tools > Export
- Login to AWS console and Create Key Pair
- Launch EC2 instance
I use Ubuntu HVM. I recommend t2.micro, as it’s free for the first year. You should specify created/uploaded key.
- Login to your EC2 instance using Public DNS or IP and your key
[bash]ssh -i .aws/your_key.pem email@example.com[/bash]
NOTE: you key should be readable only by you. To achieve that, you can do:
[bash]chmod 600 .aws/your_key.pem[/bash]
- Configure Ubuntu
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install apache2 php5 php5-mysql libapache2-mod-php5 libapache2-mod-auth-mysql mysql-server
- Configure MySQL
mysql -uroot -p
CREATE DATABASE wordpress;
CREATE USER ‘wordpress’ IDENTIFIED BY ‘SOMEPASS’;
GRANT ALL ON wordpress.* TO ‘wordpress’;
- Configure wordpress
tar xpfz latest.tar.gz
mv wp-config-sample.php wp-config.php
sudo chown -R www-data:www-data /var/www/html
# edit wp-config.php
- Configure Apache
# edit /etc/apache2/sites-available/wordpress.conf
Allow from all
# enable wordpress in apache2
sudo a2ensite wordpress
sudo service apache2 restart
- Enable HTTP access to your EC2 instance
Go to EC2 console > Instances > Select you instance > Description >
Click on your `Security group` > Select Inbound > Edit > Add rule > HTTP > Save
- Point your webrowser to your EC2 instance: http://ec2xxxxx.compute.amazonaws.com/
- Setup your wordpress account
- Upload dumped wordpress data
WP-Admin > Tools > Import > WordPress > > Upload file import
You will need to install WordPress Importer plugin.
- Assign post to correct user.
Don’t forget to Import Attachments!
- Install your favourite plugins and themes
As for plugins, I strongly recommend: JetPack, SyntaxHighlighter Evolved and Google Analytics Dashboard for WP.
- Add favicon
Copy selected favicon.ico to /var/www/html/wordpress
BTW: You may want to increase security of your instance and setup swap just in case memory usage exceeds your EC2 instance size.
I’m using several external drives for backup purposes. I was interested whether there are some differences in terms of read/write/access time between these. I have tested two drives connected directly to USB3.0 port and through USB3.0 hub:
- HITACHI Touro 2.5″ 500GB USB 3.0
- WD My Passport 2TB USB 3.0
Touro 500GB USB3.0
Touro 500GB USB3.0 HUB
WD My Passport 2TB USB3.0
WD My Passport 2TB USB3.0 HUB
There are two interesting results. First of all, there is no speed difference between both drives (read/write/access: 83MB/49MB/17ms). Thus buying super-performance (read super-expensive) external drive make no sense, as the drive speed will be limited most likely by USB3.0 port connection anyway.
Secondly, there is no speed difference if drive is attached directly to the computer USB3.0 or through USB3.0 hub. But, I have noticed mouse lags when mouse was connected through the same USB hub. Thus if you expect to perform extensive disk reads/writes it’s better to connect it directly to the computer or at least avoid many important devices to use the same hub.
I’m preparing Ubuntu image for the course. After installation of required software and datasets, the system image grew a lot. I have decided to shrink its size by disabling swap and removing unused data. But the system image didn’t shrink automatically after removal of the files. You need to do it manually:
- Run your system from LiveCD
- Install zerofree and free unused space
sudo apt-get install zerofree
sudo zerofree -v /dev/sda1
- In the host system, release and remove the image from VirtualBox (but keep it in the filesystem!)
- And compact image size
VBoxManage modifyhd Ubuntu1404/Ubuntu1404.vdi --compact</code>
- Finally, you will have to add .vdi image back to VirtualBox machine.
In my case, the .vdi image shrunk from 7.2G to 6.2G (exactly the released size under Ubuntu), so I think it’s worth the effort.
Inspired by AskUbuntu.