Skip to main content

Posts

Download All Images from a Wordpress.com Media Library

After a few months of blogging photos from my life events, I realised that I should have kept a local version (dummy me). I kept everything else, so why did I forget this time?! Anyways, I realised that this is not an easy job if you are free hosting on Wordpress.com. All I could have is either an XML with posts and references to images, or a full migration to another Wordpress blog. So I rolled up my sleeves and reused a python script I used before. Here is the script: #!/usr/bin/python # -*- coding: utf-8 -*- # This script parses a wordpress backup XML and downloads the contained media files. # Example: # python wordpress-media-downloader.py /Users/madly/Downloads/mycoolblog.wordpress.2016-05-02.xml /Users/madly/Downloads/media-library import sys import urllib2 import re # # Takes a url and a directory for saving the file. Directory must exist. # def download(url, dir_name): file_name = url.split('/')[-1] u = urllib2.urlopen(url) f = open(dir_name+'/...

PENNY (Congstar) USB Internet on Linux Mint 17 - Ubuntu 14.04

So, I've been in Germany for a while. And after using the fast WiFi in hotels, I moved to a personal apartment, with no Internet for now. I bought a PENNY USB surf stick as I thought it is a bit cheaper. But there was a problem, it is not working on Linux :(.   I lived with this fact for a while, but now I want to get back to programming. So, after some searching and trying, here is how I could use my PENNY Mobil Internet Stick, without their Internet manager of course, and that's a bit bad for calculating my overall usage. Anyways, it is straight forward: 1. Open 'Network Connections'. Click 'Add'. 2.  Choose 'Mobile Broadband'. 3. The default device is 'Internetstick'. 4. Choose your country. Mine is 'Germany'. 5. The service provider is 'Congstar'. 6. The default plan is 'Prepaid Contracts', which is my case. 7. Verify your data and click 'Apply'. 8. The connection form is p...

Ribbon Wordpress Theme - Arabic Version

In case you don't know about Ribbon , It is a free responsive WordPress magazine theme. A few years ago, I used it for a website/blog which I used to use and maintain. To reach an appealing view, it was not enough to change direction to RTL or use an automated tool that used to exist back then. So I spent some time to translate some segments and style a few elements. The final state was as follows: Ribbon is a great Wordpress theme, and I really liked its performance and clean look. So, here it is in Arabic. I hope it would be useful for someone out there. Download Arabic Ribbon

Download RSS Media Files using Python

Today I wanted to download a course from an RSS feed. The media files (mp3) were attached to the RSS entries. So instead of downloading tens of files one by one, I wrote a script! With the help of Alvin's post to parse RSS with Python , I attached a download method and the script was ready to do the work for me. First, here is the script: [ rss_downloader.py ] #!/usr/bin/python import feedparser import sys import urllib2 # # Takes a url and a directory for saving the file. Directory must exist. # def download(url, dir_name): file_name = url.split('/')[-1] u = urllib2.urlopen(url) f = open(dir_name+'/'+file_name, 'wb') meta = u.info() file_size = int(meta.getheaders("Content-Length")[0]) print "Downloading File: %s (Size: %s Bytes)" % (file_name, file_size) file_size_dl = 0 block_sz = 8192 while True: buffer = u.read(block_sz) if not buffer: break file_size_...

CSE 321 Project - Part 2 - Install Ruby, Rails, PostgreSQL, MySQL and others

This is one post in a series of posts related to CSE 321 - Software Engineering project for ASU CSE 2017 students. The series starts from setting up the environment, to planning the work on the website project, to implementation After Installing Lubuntu/Ubuntu in a VM in part 1 , we want to prepare it for development. Thinking about the required project, this is what I want to install. Ruby Rails PostgresSQL (or MySQL) Node.js Git Gitg (a graphical tool to use with Git) Atom editor (or you can install Sublime if you like) Plus enabling copy & paste between the VM and the computer, and enabling flexible display resolution to suit your taste. And I will start with this. Install Guest Additions Now we need to install some additional packages to add more power to our VM. This will make our job easier in scaling the VM window (and keeping the aspect ratio), and enables copy&paste between the VM and the host computer to easily follow the next instructions. I...

CSE 321 Project - Part 1 - Install Lubuntu on VirtualBox

This is one post in a series of posts related to CSE 321 - Software Engineering project for ASU CSE 2017 students. The series starts from setting up the environment, to planning the work on the website project, to implementation In this tutorial, we will start a virtual machine and install Lubuntu or Ubuntu. Install VirtualBox The first thing is downloading and installing VirtualBox: https://www.virtualbox.org/wiki/Downloads And assuming that you are working on Linux, then you'll go for the first link. The download link is for both 32-bit and 64-bit computers. ( note: x86 means 32-bit, amd64 means 64-bit ) Create a New Lubuntu Machine Let's create a new machine by clicking the New icon. Enter a suitable name for your machine. Any name to remind you what this machine does. Select the amount of memory this machine is allowed to use. If you have plenty of RAM, give it 2GB. No worries, this value can be changed later. Leave the default option to create a n...