Tuesday, 14 May 2013

another (pyrax) way to upload local folder to Rackspace CloudFiles

Other possible ways (I'm sure there is more):

1) curl, httpie http://docs.rackspace.com/files/api/v1/cf-devguide/content/Authentication-d1e639.html

2) bash script (not tested by me) - http://blog.chmouel.com/2010/06/09/upload-to-rackspace-cloud-files-in-a-shell-script/

3) sftp-cloudfs (not tested by me) - http://www.cyberciti.biz/faq/rackspace-openstack-cloud-upload-files-using-sftp-cloudfs-proxy/    ||   https://github.com/Memset/sftpcloudfs

4) OpenStack swift client (not tested by me) - http://goodsquishy.com/2012/08/rackspace-cloud-files-from-the-command-line/

5) turbolift - https://github.com/cloudnull/turbolift

I'm going to use pyrax in this exercise which Rackspace's SDK for python - http://docs.rackspace.com/sdks/guide/content/python.html

Code for my script is available here (I'm not responsible for any data loss while using this script) - https://github.com/marcinrozanski/api/blob/master/upload_folder.py

It assumes you've got credentials file in the following format:

$ cat ~/.rackspace_cloud_credentials
[rackspace_cloud]
username = your_username
api_key = your_API_key
$

Let's say we've got a local folder called "upload_test" with three text files.

$ ls -altr upload_test/
total 24
-rw-r--r--  1 marcin  staff    9 14 May 21:19 file1.txt
-rw-r--r--  1 marcin  staff    9 14 May 21:20 file2.txt
-rw-r--r--  1 marcin  staff    9 14 May 21:20 file3.txt
drwxr-xr-x  5 marcin  staff  170 14 May 22:14 .
drwxr-xr-x  7 marcin  staff  238 14 May 23:12 ..
$
$ cat upload_test/file*.txt 
test 123
test 123
test 123

We want to upload that folder to CloudFiles as container called "cont_test1".

$ python upload_folder.py
Enter container name: cont_test1
Enter folder to upload: upload_test
Beginning Folder Uplaod
Total bytes to upload: 27
Progress: 0.00%
Progress: 33.33%
Progress: 100.00%

Upload Complete.
$




Wednesday, 3 April 2013

Plesk 9 installer fails while 11 works fine, Plesk 9 going EOL

So I wanted to test Plesk 9 to 10 to 11 upgrade, created new server and... failed to load Plesk 9.

Fresh Centos 5.9 Cloud Server, 1GB RAM, 40GB HDD

[root@plesk ~]# cat /etc/redhat-release
CentOS release 5.9 (Final)
[root@plesk ~]# uname -a
Linux plesk 2.6.18-348.3.1.el5xen #1 SMP Mon Mar 11 20:28:48 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@plesk ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1024        157        866          0          5         39
-/+ buffers/cache:        113        910
Swap:          976          0        976
[root@plesk ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1             39G  1.2G   36G   4% /
tmpfs                 512M     0  512M   0% /dev/shm
[root@plesk ~]#

Plesk 9 installer - http://www.parallels.com/uk/download/plesk9/ , pick CentOS, Download for CentOS 5.x 64bit version, direct link -  http://download1.parallels.com/Plesk/PPP9/CentOS5/parallels_installer_v3.6.0_build100407.15_os_CentOS_5_x86_64

On "Select the desired products and their versions" page I've tried 11.0.9, 10.4.4 and 9.5.4 all got stuck with the following error message.

Select the desired products and their versions
===============================================================================

The following product versions are available:

1. [*] Parallels Plesk Panel
  2. (*) Parallels Plesk Panel 11.0.9 (stable)
  3. ( ) Parallels Plesk Panel 10.4.4 (stable)
  4. ( ) Parallels Plesk Panel 10.3.1
  5. ( ) Parallels Plesk Panel 10.3.0
  6. ( ) Parallels Plesk Panel 10.2.0
  7. ( ) Parallels Plesk Panel 10.1.1
  8. ( ) Parallels Plesk Panel 10.1.0
  9. ( ) Parallels Plesk Panel 10.0.1
  10. ( ) Parallels Plesk Panel 10.0.0
  11. ( ) Parallels Plesk Panel 9.5.4
  12. ( ) Parallels Plesk Panel 9.5.3
  13. ( ) Parallels Plesk Panel 9.5.2
  14. ( ) Parallels Plesk Panel 9.5.1
  15. ( ) Parallels Plesk Panel 9.5.0
  16. ( ) Parallels Plesk Panel 9.3.0
  17. ( ) Parallels Plesk Panel 9.2.3
  18. ( ) Parallels Plesk Panel 9.2.2
  19. ( ) Parallels Plesk Panel 9.2.1
  20. ( ) Parallels Plesk Panel 9.2.0
  21. ( ) Parallels Plesk Panel 9.0.1
  22. ( ) Parallels Plesk Panel 9.0.0
  23. ( ) Plesk 8.6.0
  24. ( ) Plesk 8.4.1
  25. ( ) Plesk 8.4.0
  26. ( ) Plesk 8.3.0
  27. ( ) Plesk 8.2.1
  28. ( ) Plesk 8.2.0

29. [ ] Parallels Small Business Panel

30. [ ] Sitebuilder 4.5 and earlier versions (for Plesk 9 and earlier)

31. [ ] SSO

N) Go to the next page; P) Go to the previous page; Q) Cancel installing
To select a version, type the respective number;
Select an action [N]:
File downloading PSA_11.0.9/plesk-11.0.9-cos5-x86_64.inf3: 11%..22%..30%..44%..55%..60%..72%..85%..90%..100% was finished.
ERROR: The root element is named incorrectly in the file /root/parallels/PSA_11.0.9/plesk-11.0.9-cos5-x86_64.inf3
Not all packages were installed.
Please, contact product technical support.
[root@plesk ~]#


Plesk 11 installer - http://www.parallels.com/uk/download/plesk/installer/, pick CentOS, Download for CentOS 5.x 64bit version, direct link -  http://download1.parallels.com/Plesk/PP11/11.0/CentOS5/parallels_installer_v3.12.0_build120601.16_os_CentOS_5_x86_64

Please note the date difference between both packages!

[root@plesk ~]# pwd
/root
[root@plesk ~]# ls -ltr
total 15852
-rwxr-xr-x 1 root root 6592768 Dec 21  2010 parallels_installer_v3.6.0_build100407.15_os_CentOS_5_x86_64
-rwxr-xr-x 1 root root 9592224 Jun  1  2012 parallels_installer_v3.12.0_build120601.16_os_CentOS_5_x86_64
drwxr-xr-x 5 root root    4096 Apr  3 11:34 parallels
[root@plesk ~]#

No issues with the installation when installer for version 11 is used.

Select the desired products and their versions
===============================================================================

The following product versions are available:

1. [*] Parallels Plesk Panel
  2. (*) Parallels Plesk Panel 11.0.9 (stable)

3. [ ] Parallels Small Business Panel

4. [ ] Sitebuilder 4.5 and earlier versions (for Plesk 9 and earlier)

5. [ ] SSO

N) Go to the next page; P) Go to the previous page; Q) Cancel installing
To select a version, type the respective number;
Select an action [N]:

AFTER SOME TIME

**** Package phpmyadmin scriptlet completed successfully.

Trying to unpack billing fixes from MU43-billing.zip... billing not installed. Skipping...
Patches were installed successfully.
The changes were applied successfully.

[root@plesk ~]# cat /usr/local/psa/version 
11.0.9 CentOS 5 110120608.16
[root@plesk ~]# 

Message is clear, Plesk 9 is so EOL! - http://www.parallels.com/uk/plesk/lifecycle/

Wednesday, 16 January 2013

How to get WiFi working on MacBook Pro 13" under Ubuntu

MacBook Pro 13" i5 Late 2011

WiFi controller:

root@mac:~# lspci | grep -i network
03:00.0 Network controller: Broadcom Corporation BCM4331 802.11a/b/g/n (rev 02)
root@mac:~#


Steps to install the firmware (use sudo or run as root):

# apt-get install b43-fwcutter
# wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2
# tar xf broadcom-wl-5.100.138.tar.bz2 
# b43-fwcutter -w "/lib/firmware" broadcom-wl-5.100.138/linux/wl_apsta.o 
# echo 'SUSPEND_MODULES="b43 bcma"' >> /etc/pm/config.d/default
# reboot

I assume it will work on Fedora just change the first command to:

yum install b43-fwcutter

Sunday, 18 November 2012

Raspberry Pi, breadboard and GPIO

Here is the kit I got for my birthday - http://www.skpang.co.uk/catalog/starter-kita-for-raspberry-pi-pi-not-include-p-1070.html

I've found some interesting links on how to start having fun with SGPIO:

1) GPIO Traffic Light demo on the Raspberry Pi with Python or C - http://www.skpang.co.uk/blog/archives/656

2) Safe, controlled access to GPIO on the Raspberry Pi - http://quick2wire.com/2012/05/safe-controlled-access-to-gpio-on-the-raspberry-pi/

3) Getting Started with Raspberry Pi GPIO and Python - http://lwk.mjhosting.co.uk/?p=343

4) GPIO Examples - https://projects.drogon.net/raspberry-pi/gpio-examples/

minty geek, "cookie jar alarm" test

I absolutely enjoy my new Minty Geek kit (thanks Ania :-*) - http://mintygeek.com/

Here is a video of  the "cookie jar alarm" test - http://www.youtube.com/watch?v=7u8ibJa_gVY

It's using two transistors, relay, foto-resistor to sense the light and 555IC.

MacBook Pro 13" late 2011 running Fedora GNU/Linux 17 64it

When I 1st got my MacBook Pro (13" late 2011) I wasn't happy with its performance - The Spinning Beach Ball of Death. The bottleneck was it's 5,4k rpm HDD which I replaced with Seagate Momentus XT and kept the "slow" original as a Time Machine backup drive. In the same time I've doubled the RAM to 8GB and the machine became useable workstation.

This weekend I've replaced the HDD with some standard 7,2k I had and installed Fedora 17 64bit just because I can (wanted to see how hard it's gonna be) ;-).

I had some fun getting WiFi to work and this article was the answer - http://linuxwireless.org/en/users/Drivers/b43

The rest was as easy as installing it on PC - no difference at all !

Here is a video of my Mac booting into Fedora 17 - http://www.youtube.com/watch?v=R7fdeope8c0

Monitor backlight control, keyboard backlight control and rest of hardware worked out-of-the-box.

Wednesday, 10 October 2012

test cloud loadbalancer


mac:~ martin$ for i in {1..10} ; do echo "load balancer call by curl: "$i ; curl http://marcincloud.no-ip.org ; done
load balancer call by curl: 1
test centos2
load balancer call by curl: 2
test centos1
load balancer call by curl: 3
test centos2
load balancer call by curl: 4
test centos1
load balancer call by curl: 5
test centos2
load balancer call by curl: 6
test centos1
load balancer call by curl: 7
test centos2
load balancer call by curl: 8
test centos1
load balancer call by curl: 9
test centos2
load balancer call by curl: 10
test centos1
mac:~ martin$