<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1093052595864541863</id><updated>2026-06-16T21:12:29.281-07:00</updated><category term="linux"/><category term="ubuntu"/><category term="python"/><category term="django"/><category term="windows"/><category term="act2009"/><category term="network"/><category term="centos"/><category term="lxml"/><category term="ssh"/><category term="debian"/><category term="java"/><category term="nic"/><category term="printer"/><category term="server"/><category term="tg2"/><category term="vnc"/><category term="xml"/><category term="xpath"/><category term="TurboGears 2"/><category term="backup"/><category term="dd"/><category term="distribute"/><category term="django orm"/><category term="django-admin"/><category term="django-tastypie"/><category term="dlink"/><category term="dns320"/><category term="dos"/><category term="download"/><category term="gnome"/><category term="html"/><category term="javascript"/><category term="json"/><category term="large file"/><category term="localization"/><category term="nas"/><category term="network interface"/><category term="outlook"/><category term="programming"/><category term="receipt printer"/><category term="relationship"/><category term="remote"/><category term="restful"/><category term="resume"/><category term="screen"/><category term="security"/><category term="sftp"/><category term="sprox"/><category term="text file"/><category term="urllib"/><category term="urllib2"/><category term="victor wooten"/><category term="web"/><category term="web server"/><category term="web service"/><category term="act2000"/><category term="apache httpclient"/><category term="api"/><category term="apikeyauthentication"/><category term="aptana"/><category term="authenticate"/><category term="automatic"/><category term="automatic login"/><category term="autostart"/><category term="avahi"/><category term="awk"/><category term="bad marshal data"/><category term="bass"/><category term="bchunk"/><category term="bin"/><category term="binary"/><category term="brian bromberg"/><category term="broadcast"/><category term="bugs"/><category term="c#"/><category term="calendar"/><category term="canon"/><category term="centos 6"/><category term="cherrypy"/><category term="chromium browser"/><category term="chromium os"/><category term="comparison"/><category term="convert"/><category term="corrupt"/><category term="crash"/><category term="crm"/><category term="css"/><category term="css selector"/><category term="custom user"/><category term="cygpath"/><category term="cygwin"/><category term="database"/><category term="date"/><category term="date format"/><category term="db transaction"/><category term="deep serialization"/><category term="designer"/><category term="detach"/><category term="dhcp"/><category term="django-admin.py"/><category term="django-blog-zinnia"/><category term="eclipse"/><category term="ecryptfs"/><category term="encrypt"/><category term="error 4"/><category term="exclude"/><category term="extend"/><category term="extension"/><category term="fedora"/><category term="file name"/><category term="flash plugin"/><category term="flecktones"/><category term="fontconfig-config"/><category term="fonts"/><category term="freeze"/><category term="garbled"/><category term="gconf-editor"/><category term="gdm"/><category term="google calendar"/><category term="google chrome os"/><category term="group by"/><category term="gson"/><category term="highcharts"/><category term="hostname"/><category term="https"/><category term="ibm system x3650 m3"/><category term="idioms"/><category term="image"/><category term="imagefield"/><category term="initial value"/><category term="inline"/><category term="installation"/><category term="iso"/><category term="issue"/><category term="jazz"/><category term="jquery"/><category term="kde"/><category term="keyboard"/><category term="lan"/><category term="landscape"/><category term="lftp"/><category term="libxml"/><category term="livecd"/><category term="local connection only"/><category term="locale"/><category term="lock"/><category term="login"/><category term="logo"/><category term="ls"/><category term="ltp1 to usb"/><category term="lxde"/><category term="mbr"/><category term="messy"/><category term="migration"/><category term="mirror"/><category term="mockrunner"/><category term="model"/><category term="module"/><category term="mp145"/><category term="multipart"/><category term="nautilus"/><category term="netbios"/><category term="netcat"/><category term="networ"/><category term="network boot"/><category term="networkmanager"/><category term="nodm"/><category term="nohup"/><category term="novnc"/><category term="nsswitch.conf"/><category term="partial"/><category term="permanent configuration"/><category term="pil"/><category term="ping"/><category term="plural"/><category term="pos"/><category term="post"/><category term="primary key"/><category term="print"/><category term="privacy"/><category term="problem"/><category term="ps2"/><category term="pst"/><category term="pxe"/><category term="pydev"/><category term="python imaging library"/><category term="qt"/><category term="queryset"/><category term="r8168"/><category term="r8169"/><category term="redhat"/><category term="regex"/><category term="reminder"/><category term="remote desktop"/><category term="remove bytes"/><category term="restore"/><category term="robocopy"/><category term="rs323"/><category term="rsync"/><category term="saver"/><category term="scheduler"/><category term="scp"/><category term="sdk"/><category term="sed"/><category term="sendkey"/><category term="serialization"/><category term="serialize"/><category term="service"/><category term="servlet"/><category term="share file"/><category term="shell"/><category term="shortcut keys"/><category term="sign-up"/><category term="socketchannel"/><category term="speed"/><category term="speed up"/><category term="svn"/><category term="sync"/><category term="syndaemon"/><category term="terminal"/><category term="testing"/><category term="tg2.1"/><category term="time"/><category term="toolbar"/><category term="touchpad"/><category term="tsocks"/><category term="tunnel"/><category term="ubuntu 10.04.3 LTS"/><category term="ubuntu 11.10"/><category term="unit test"/><category term="usb"/><category term="vb.net"/><category term="vino"/><category term="virtual ip"/><category term="virtual ltp1"/><category term="virtual nic"/><category term="wifi"/><category term="winbind"/><category term="windows xp"/><category term="wlan"/><category term="wpa2"/><category term="wpa_action"/><category term="wpa_passphrase"/><category term="wpa_supplicant"/><category term="wsgiserver"/><category term="xrandr"/><title type='text'>Murzal Arsya</title><subtitle type='html'>Computer and stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>101</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-3246060399272155382</id><published>2012-12-18T02:06:00.001-08:00</published><updated>2013-01-24T04:01:37.802-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="avahi"/><category scheme="http://www.blogger.com/atom/ns#" term="networ"/><category scheme="http://www.blogger.com/atom/ns#" term="sftp"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><title type='text'>Advertise SFTP on Network using Avahi</title><content type='html'>I just realized that I can broadcast / advertise my SFTP server to other computers connected to the network.&lt;br /&gt;
&lt;br /&gt;
Go to /etc/avahi/services&lt;br /&gt;
and create a file named sftp.service, which contains:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!--*-nxml-*--&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;service-group&gt;&lt;/service-group&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;name replace-wildcards=&quot;yes&quot;&gt;%h SFTP&lt;/name&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;service&gt;&lt;/service&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;type&gt;_sftp-ssh._tcp&lt;/type&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;port&gt;22&lt;/port&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Now, you can see your SFTP server in Nautilus.&lt;br /&gt;
&lt;br /&gt;
This &lt;a href=&quot;http://holyarmy.org/2008/01/advertising-linux-services-via-avahibonjour/&quot; target=&quot;_blank&quot;&gt;guy&lt;/a&gt; has more complete list on what can be broadcast using avah i</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/3246060399272155382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/12/advertise-sftp-on-network-using-avahi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/3246060399272155382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/3246060399272155382'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/12/advertise-sftp-on-network-using-avahi.html' title='Advertise SFTP on Network using Avahi'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-3621910535898235587</id><published>2012-10-17T21:36:00.000-07:00</published><updated>2012-10-17T21:36:17.740-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="custom user"/><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="login"/><category scheme="http://www.blogger.com/atom/ns#" term="sign-up"/><title type='text'>Django Login and Sign-Up Page Together</title><content type='html'>It is very common to combine login and sign-up form in one page, so I implemented it in django. Here&#39;s how I do it.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
First,&amp;nbsp;create UserForm class which contains whatever information you need, such as: username, password, full name, address, email, gender, etc.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;div&gt;
Second, add login url to your urls.py, something like the following:&lt;/div&gt;
&lt;div&gt;
(r&#39;^/login/$&#39;, &#39;django.contrib.auth.views.login&#39;, { &#39;template_name&#39;: &#39;myapp/login.html&#39;, &#39;reg_form&#39;: UserForm()&amp;nbsp;}),&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Third, create in your template folder myapp/login.html which content is like shown in docs.djangoproject.com/en/dev/topics/auth/ (search for&amp;nbsp;sample registration/login.html)&lt;/div&gt;
&lt;div&gt;
Make sure you use the exact same variable name (form, next, etc), unless you know what you are doing.&lt;/div&gt;
&lt;div&gt;
Also, in this template, add another html form and render your&amp;nbsp;UserForm&amp;nbsp;object (in my case the variable name is reg_form.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Fourth, create sign_up view, which perform whatever it is necessary in order to save the new user. Make sure you add { &#39;form&#39;: django.contrib.auth.forms.AuthenticationForm() } to the context data.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Sixth, add sign_up url to your urls.py, something like the following:&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
(r&#39;^/sign-up/$&#39;, myapp.views.sign_up ),&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Notes:&lt;/div&gt;
&lt;div&gt;
I created my own User class with additional information that django user (auth_user) does not provide. In order to do that, I create (custom) User with a OneToOne relationship with django user which is also the primary_key.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
That&#39;s how I do it. Hopefully, give you some ideas if you want to implement something similar.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/3621910535898235587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/10/django-login-and-sign-up-page-together.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/3621910535898235587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/3621910535898235587'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/10/django-login-and-sign-up-page-together.html' title='Django Login and Sign-Up Page Together'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-8264205562195862053</id><published>2012-08-04T09:19:00.002-07:00</published><updated>2012-08-04T09:19:55.342-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apache httpclient"/><category scheme="http://www.blogger.com/atom/ns#" term="django-tastypie"/><category scheme="http://www.blogger.com/atom/ns#" term="gson"/><category scheme="http://www.blogger.com/atom/ns#" term="restful"/><category scheme="http://www.blogger.com/atom/ns#" term="web service"/><title type='text'>Consuming Django Tastypie RESTful WS with Apache HTTPClient and GSON</title><content type='html'>Creating RESTful Web Service is so simple using Django Tastypie. It&#39;s pretty much just about registering which model you want to expose. Even more amazing is that filtering feature. Read &lt;a href=&quot;http://django-tastypie.readthedocs.org/en/latest/resources.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt; to get more info about it.&lt;br /&gt;
&lt;br /&gt;
I decided to create Java frontend to replace the existing, which uses Python Gtk. To keep with the existing look and feel I use &lt;a href=&quot;http://java-gnome.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;java-gnome&lt;/a&gt; binding. The transition from python gtk to java-gnome is quite smooth. Java-gnome has such a good design, so the only thing that I need to for the transition is just adapting to the java paradigm, which is wonderful.&lt;br /&gt;
&lt;br /&gt;
To get the JSON object from the web service, I chose Apache HTPClient, just to make things simple. I know that there are a lot of java REST client, such as restlet, jersey, etc. I stick with the simplest one.&lt;br /&gt;
The next thing is to figure out how to transform JSON result from the RESTful web service to POJO. &amp;nbsp;Here comes GSON to the rescue. I did not want to use python attribute name convention in my java codes. So, this one I need to solve. Fortunately, GSON comes with clever and handy feature named &lt;a href=&quot;http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/FieldNamingPolicy.html&quot; target=&quot;_blank&quot;&gt;FieldNamingPolicy&lt;/a&gt;. Obviously they have really good experience in different programming language hence this feature available.&lt;br /&gt;
&lt;br /&gt;
To give example on how to use it, taken from the site:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SomeObject someObject = new SomeObject(&quot;first&quot;, &quot;second&quot;);&lt;br /&gt;
Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();&lt;br /&gt;
String jsonRepresentation = gson.toJson(someObject);&lt;br /&gt;
System.out.println(jsonRepresentation);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Awesome! That simple and you can keep the java attribute naming convention and make your java codes look good.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/8264205562195862053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/08/consuming-django-tastypie-restful-ws.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8264205562195862053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8264205562195862053'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/08/consuming-django-tastypie-restful-ws.html' title='Consuming Django Tastypie RESTful WS with Apache HTTPClient and GSON'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-8354001524962699000</id><published>2012-07-06T05:51:00.000-07:00</published><updated>2012-09-02T22:54:06.623-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="fontconfig-config"/><category scheme="http://www.blogger.com/atom/ns#" term="fonts"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Debian with Ubuntu Fonts</title><content type='html'>Here is how I configure my Debian system to use the same font config as Ubuntu.&lt;br /&gt;
Simply download, &lt;a href=&quot;http://packages.ubuntu.com/precise/all/fontconfig-config/download&quot; target=&quot;_blank&quot;&gt;fontconfig-config_2.8.0-3ubuntu9_all.deb&lt;/a&gt;. The link will take you to Ubuntu 12.04 fontconfig-config deb package.&lt;br /&gt;
After you saved that deb file, extract it to get its contents:&lt;br /&gt;
$&amp;nbsp;dpkg-deb -x fontconfig-config_2.8.0-3ubuntu9_all.deb /tmp/extract/&lt;br /&gt;
&lt;br /&gt;
then replace the content of Debian&#39;s /etc/fonts/* with data from /tmp/extract/etc/fonts/*&lt;br /&gt;
&lt;br /&gt;
$ sudo cp -r /tmp/extract/etc/fonts/* /etc/fonts/&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Logout and log back in to see the change.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/8354001524962699000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/07/debian-with-ubuntu-fonts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8354001524962699000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8354001524962699000'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/07/debian-with-ubuntu-fonts.html' title='Debian with Ubuntu Fonts'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-2484134233327465593</id><published>2012-05-03T04:28:00.001-07:00</published><updated>2012-05-03T04:28:23.753-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="landscape"/><category scheme="http://www.blogger.com/atom/ns#" term="print"/><category scheme="http://www.blogger.com/atom/ns#" term="printer"/><title type='text'>Using CSS to Make Your HTML Page Printer Friendly</title><content type='html'>Besides for styling for regular media (such as screen / pc monitor), css can also be used to make the web layout suitable for printing.&lt;br /&gt;
Perhaps you have a web page which has logo, menu, navigation, videos, and other things on it. Also there is a table or other information which you actually need. You would not want those irrelevant elements cluttering all over when you print it, right?&lt;br /&gt;
&lt;br /&gt;
To solve it, simple use specific stylesheet for printing purpose and define it for &quot;print&quot; media. Here is an example of using external stylesheet for &quot;print&quot; media:&lt;br /&gt;
&lt;link href=&quot;page_print.css&quot; media=&quot;print&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;&lt;br /&gt;
&lt;br /&gt;
Next step is to eliminate those unnecessary elements using display: none. Here&#39;s an example:&lt;br /&gt;
div#menu {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;display: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Now, as a bonus, I found out a way to make the default printing orientation as landscape. Here&#39;s it is:&lt;br /&gt;
&lt;br /&gt;
@page {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;size: landscape;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Another interesting thing that I found during my work is that&amp;nbsp;!important &lt;a href=&quot;http://www.w3.org/TR/CSS21/cascade.html#important-rules&quot; target=&quot;_blank&quot;&gt;rule&lt;/a&gt;&amp;nbsp;defined in other css for any other media other than &quot;print&quot; will also effects the &quot;print&quot; media layout. I did not expect that, since I assume that !important rules defined for &quot;screen&quot; media, for example, would only effect that particular media. So, make sure you override the !important rule in the &quot;print&quot; css.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/2484134233327465593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/05/using-css-to-make-your-html-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/2484134233327465593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/2484134233327465593'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/05/using-css-to-make-your-html-page.html' title='Using CSS to Make Your HTML Page Printer Friendly'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-3206273777043465810</id><published>2012-04-09T07:57:00.001-07:00</published><updated>2012-04-09T07:57:09.712-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="authenticate"/><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="django-blog-zinnia"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="queryset"/><title type='text'>Django Blog Zinnia Limit User to Own Entry/Post</title><content type='html'>I just need a simple yet flexible django based blog application, and found django-blog-zinnia. I really admire how simple it is. The only major adjustment that I need is to limit user to his/her own blog entry/post.&lt;br /&gt;
&lt;br /&gt;
Combining basic django (admin) knowledge with soome info from django-blog-zinnia documentation, I found a simple solution.&amp;nbsp;Of course this is related with django-blog-zinnia&#39;s admin interface, and there is a documentation about how to make some modification to the EntryAdmin. Read more from &lt;a href=&quot;http://django-blog-zinnia.com/documentation/how-to/extending_entry_model/#updating-the-admin-interface&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The idea is to create a django application and create admin.py on that app&#39;s top level directory (the same location with models.py).&lt;br /&gt;
&lt;br /&gt;
Here is how my admin.py codes look like:&lt;br /&gt;
############# admin.py #################&lt;br /&gt;
&lt;br /&gt;
from django.contrib import admin&lt;br /&gt;
from zinnia.models import Entry&lt;br /&gt;
from zinnia.admin.entry import EntryAdmin&lt;br /&gt;
&lt;br /&gt;
class FilteredEntryAdmin(EntryAdmin):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; def queryset(self, request):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; qs = super(FilteredEntryAdmin, self).queryset(request)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if request.user.is_superuser:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return qs&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return qs.filter(authors=request.user)&lt;br /&gt;
&lt;br /&gt;
admin.site.unregister(Entry)&lt;br /&gt;
admin.site.register(Entry, FilteredEntryAdmin)&lt;br /&gt;
&lt;br /&gt;
############# end of admin.py #################&lt;br /&gt;
&lt;br /&gt;
Remember to add the newly created app in settings.py INSTALLED_APPS, and make sure you put it below zinnia.&lt;br /&gt;
&lt;br /&gt;
Django&#39;s documentation is quite complete and comprehensive. To get more information about ModelAdmin, queryset, etc, go to this &lt;a href=&quot;https://docs.djangoproject.com/en/dev/ref/contrib/admin/&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;. From there I got the idea of overriding the queryset and use filter to limit the entry based on user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/3206273777043465810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/04/django-blog-zinnia-limit-user-to-own.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/3206273777043465810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/3206273777043465810'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/04/django-blog-zinnia-limit-user-to-own.html' title='Django Blog Zinnia Limit User to Own Entry/Post'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-5399738436062080481</id><published>2012-04-09T07:41:00.001-07:00</published><updated>2012-05-10T01:32:09.304-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="imagefield"/><category scheme="http://www.blogger.com/atom/ns#" term="pil"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="python imaging library"/><title type='text'>(pip) Install Python Imaging Library (PIL)</title><content type='html'>I had a problem when I tried installing &lt;a href=&quot;http://www.pythonware.com/products/pil/&quot; target=&quot;_blank&quot;&gt;Python Imaging Library (PIL)&lt;/a&gt;&amp;nbsp;version 1.1.7, within virtualenv, using pip. Actually, there was not any errors raised during installation, but when I used it in Django for the ImageField, I kept getting &#39;Upload a valid image. The file you uploaded was either not an image or a corrupted image&#39; error message.&lt;br /&gt;
I figured out that the problem is due to the manual installation of PIL using pip, instead of using Debian/Ubuntu&#39;s apt-get.&lt;br /&gt;
So, the simplest solution would be using the&lt;br /&gt;
$&amp;nbsp;sudo apt-get install python-imaging&lt;br /&gt;
&lt;br /&gt;
The thing is, I need PIL installed in my virtualenv environment. Getting some info from &lt;a href=&quot;http://stackoverflow.com/questions/8575120/django-upload-a-valid-image/8575627#8575627&quot; target=&quot;_blank&quot;&gt;this link&lt;/a&gt;, I figured out a way to install PIL within virtualenv. In order to do that, some changes need to be done inside the PIL&#39;s setup.py script.&lt;br /&gt;
Step 0: sudo apt-get install libjpeg62 libjpeg62-dev&lt;br /&gt;
Step 1: get PIL source kit (&lt;a href=&quot;http://effbot.org/downloads/Imaging-1.1.7.tar.gz&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;).&lt;br /&gt;
Step 2: untar, unzip the file&lt;br /&gt;
Step 3: locate setup.py from Step 2, and open that file for editing&lt;br /&gt;
Step 4:&amp;nbsp;around line 200 (you should see other paths around there), add the following&lt;br /&gt;
add_directory(library_dirs, &quot;/usr/lib/i386-linux-gnu&quot;) &amp;nbsp;# for 64 bit replace with&amp;nbsp;/usr/lib/x86_64-linux-gnu&lt;br /&gt;
Step 5: tar and gzip the modified PIL source.&lt;br /&gt;
Step 6:&amp;nbsp;activate your virtualenv, should you need it&lt;br /&gt;
Step 7: pip install &lt;modified_pil_source.tar.gz&gt;&lt;/modified_pil_source.tar.gz&gt;&lt;br /&gt;
&lt;br /&gt;
I made some test with my &lt;a href=&quot;http://django-blog-zinnia.com/blog/&quot; target=&quot;_blank&quot;&gt;django-blog-zinnia&lt;/a&gt; project, by uploading some pictures and no more error messages.</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/5399738436062080481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/04/pip-install-python-imaging-library-pil.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/5399738436062080481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/5399738436062080481'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/04/pip-install-python-imaging-library-pil.html' title='(pip) Install Python Imaging Library (PIL)'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-4138773080080160198</id><published>2012-04-05T18:31:00.001-07:00</published><updated>2012-04-05T18:31:50.050-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="networkmanager"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><category scheme="http://www.blogger.com/atom/ns#" term="wlan"/><category scheme="http://www.blogger.com/atom/ns#" term="wpa2"/><category scheme="http://www.blogger.com/atom/ns#" term="wpa_action"/><category scheme="http://www.blogger.com/atom/ns#" term="wpa_passphrase"/><category scheme="http://www.blogger.com/atom/ns#" term="wpa_supplicant"/><title type='text'>Disable Network Manager and Use Script to Connect to WPA2 Wireless Connection</title><content type='html'>I would like some of the computers at my work to be able to connect to a specific wireless access point with WPA2 encryption and keep trying to connect (indefinitely) if the Access Point (AP) is not on yet. When the AP is up and running, those computers should be able to connect without any human interaction. There is a possibility that the AP is turned off for a while or restarted, due to some reason, and those computers should be able to reconnect automatically when the AP is back online again.&lt;br /&gt;
&lt;br /&gt;
The default behavior on Ubuntu and Fedora is a little bit different (but far from my need). When a computer is already connected to AP, and the AP suddenly becomes unavailable for a while, there will be a WEP/WPA password dialog. User has to click the connect button again and if the AP is not available yet it will keep showing password dialog. When the user click cancel button, it will stop trying to connect to that particular AP.&lt;br /&gt;
&lt;br /&gt;
Finally I figured out how to set the computer to keep trying to connect indefinitely and no matter how many times the AP becomes unavailable, it will keep doing it until it is (re)connected.&lt;br /&gt;
&lt;br /&gt;
Here is how I did it:&lt;br /&gt;
The main issue is with the default behavior of the NetworkManager. I have not found any NetworkManager configuration so I could set it the way I explained earlier. Please let me know if someone knows how to do the exact thing that I need using NetworkManager.&lt;br /&gt;
&lt;br /&gt;
The first step is to&amp;nbsp;disable NetworkManager:&lt;br /&gt;
To&amp;nbsp;disable it temporarily, use the following command:&lt;br /&gt;
$ sudo service network-manager stop&lt;br /&gt;
&lt;br /&gt;
To permanently disable NetworkManager, do the following:&lt;br /&gt;
edit /etc/init/network-manager.conf&lt;br /&gt;
comment &quot;start on...&quot;, so it would be like the following:&lt;br /&gt;
# start on&lt;br /&gt;
&lt;br /&gt;
Next step is to create a wpa supplicant configuration file, do the following:&lt;br /&gt;
Create&amp;nbsp;&quot;/etc/wpa_supplicant/wpa_supplicant.conf&quot; file and make it executable.&lt;br /&gt;
Put the following configurations inside it:&lt;br /&gt;
########### wpa_supplicant.conf ############&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ctrl_interface=/var/run/wpa_supplicant&lt;br /&gt;
&lt;br /&gt;
network={&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ssid=&quot;your_wlan_essid&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; scan_ssid=1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; key_mgmt=WPA-PSK&lt;br /&gt;
&amp;nbsp; &amp;nbsp; psk=&quot;your_wpa2_passphrase&quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
########### end of wpa_supplicant.conf ############&lt;br /&gt;
&lt;br /&gt;
Now, I am not really comfortable to put my plain text wpa2 passphrase inside the config file. So, I use the following method:&lt;br /&gt;
$ wpa_passphrase your_wlan_essid your_plain_text_passphrase&lt;br /&gt;
&lt;br /&gt;
Use the output of the command above for your encrypted passphrase&lt;br /&gt;
&lt;br /&gt;
Third step is to edit the /etc/network/interfaces configuration file.&lt;br /&gt;
Here is how my config file looks:&lt;br /&gt;
############# /etc/network/interfaces ###########&lt;br /&gt;
&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
auto wlan0&lt;br /&gt;
iface wlan0 inet dhcp&lt;br /&gt;
&amp;nbsp; &amp;nbsp;wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf&lt;br /&gt;
&amp;nbsp; &amp;nbsp;wpa-action /etc/wpa_supplicant/action_wpa.sh&lt;br /&gt;
&lt;br /&gt;
############# end of /etc/network/interfaces ###########&lt;br /&gt;
&lt;br /&gt;
Notice that&amp;nbsp;/etc/wpa_supplicant/wpa_supplicant.conf is the configuration file we just created previously, and&amp;nbsp;/etc/wpa_supplicant/action_wpa.sh should exist from the default ubuntu (11.10) installation.&lt;br /&gt;
&lt;br /&gt;
Now for the test:&lt;br /&gt;
Test #1&lt;br /&gt;
Make sure your AP is on.&lt;br /&gt;
Restart your computer, and after you logged in, you should be connected to AP.&lt;br /&gt;
&lt;br /&gt;
Test #2&lt;br /&gt;
&lt;br /&gt;
Make sure your AP is off.&lt;br /&gt;
Restart your computer, and after you logged in, you should not be connected to AP.&lt;br /&gt;
&lt;br /&gt;
Turn on your AP.&lt;br /&gt;
Not long after that your computer should be connected to AP.&lt;br /&gt;
&lt;br /&gt;
Test #2&lt;br /&gt;
Make sure your AP is on and your computer is connected to AP.&lt;br /&gt;
Turn off your AP.&lt;br /&gt;
Your computer should be disconnected from AP.&lt;br /&gt;
Wait for a while to be sure that your computer is not connected and the retry connection attempt failed.&lt;br /&gt;
&lt;br /&gt;
Turn back your AP on.&lt;br /&gt;
Not long after that your computer should be reconnected to AP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, this is exactly what I want for my setting at work.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/4138773080080160198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/04/disable-network-manager-and-use-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/4138773080080160198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/4138773080080160198'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/04/disable-network-manager-and-use-script.html' title='Disable Network Manager and Use Script to Connect to WPA2 Wireless Connection'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-580049299391188738</id><published>2012-03-26T04:51:00.002-07:00</published><updated>2012-03-26T04:51:40.427-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="share file"/><category scheme="http://www.blogger.com/atom/ns#" term="web server"/><title type='text'>Python SimpleHTTPServer</title><content type='html'>I needed to do some test and share a file on different machine. Fortunately there is a very simple solution for what I need, which is using Python&#39;s SimpleHTTPServer.&lt;br /&gt;
What I needed to do is simply go to the directory where the file is and then execute the following command:&lt;br /&gt;
&lt;br /&gt;
$ python -m SimpleHTTPServer&lt;br /&gt;
&lt;br /&gt;
Executing above command without arguments will run the webserver on 0.0.0.0:8000.&lt;br /&gt;
&lt;br /&gt;
For more information just click&amp;nbsp;&lt;a href=&quot;http://docs.python.org/library/simplehttpserver.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/580049299391188738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/03/python-simplehttpserver.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/580049299391188738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/580049299391188738'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/03/python-simplehttpserver.html' title='Python SimpleHTTPServer'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-8053647722950048537</id><published>2012-02-21T07:32:00.000-08:00</published><updated>2013-08-18T20:51:45.363-07:00</updated><title type='text'>Disable Google Chrome Developer Tools</title><content type='html'>Finally, I found a way to disable google chrome developer tools. I need it because I have some browser based application that I need to deploy, and google chrome is really suitable for my need. The only thing that prevented me doing so is the dev tools. I don&#39;t want user to play around with the dev tools, do some hacking and stuff. No way!&lt;br /&gt;
Now, here is how to disable devtools:&lt;br /&gt;
Edit ~/.config/google-chrome/Default/Preferences&lt;br /&gt;
On Mac OSX: ~/Library/Application Support/Google/Chrome/Default &lt;br /&gt;
Add &quot;disabled&quot;: true to the &quot;devtools&quot; key, so it becomes like the following:&lt;br /&gt;
&quot;devtools&quot;: { &quot;disabled&quot;: true, &quot;split_location&quot;: 256 }&lt;br /&gt;
Save it, and restart browser. Done!&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/5692006/how-to-uninstall-remove-developer-tools-from-google-chrome/9274947#9274947&quot; target=&quot;_blank&quot;&gt;Here&lt;/a&gt; is where I originally found the solution.</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/8053647722950048537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/02/disable-google-chrome-developer-tools.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8053647722950048537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8053647722950048537'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/02/disable-google-chrome-developer-tools.html' title='Disable Google Chrome Developer Tools'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-6704002058350874546</id><published>2012-01-16T20:13:00.000-08:00</published><updated>2012-01-16T20:19:46.651-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu 11.10"/><category scheme="http://www.blogger.com/atom/ns#" term="virtual ip"/><category scheme="http://www.blogger.com/atom/ns#" term="virtual nic"/><title type='text'>Ubuntu 11.10 Virtual NIC IP Workaround</title><content type='html'>The normal way of adding virtual nic ip is by setting it in /etc/network/interfaces, like the following:&lt;br /&gt;
&lt;br /&gt;
auto eth0:0&lt;br /&gt;
iface eth0:0 inet static&lt;br /&gt;
address 192.168.0.111&lt;br /&gt;
netmask 255.255.255.0&lt;br /&gt;
broadcast 192.168.0.255&lt;br /&gt;
gateway 192.168.0.1&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Unfortunately, there is a known bug which prevent such configuration to work. Take a look &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/876829&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The first workaround that I figured out is by using /etc/rc.local script.&lt;/div&gt;
&lt;div&gt;
Add the following lines before exit(0) inside that script:&lt;/div&gt;
&lt;div&gt;
#################################&lt;/div&gt;
&lt;div&gt;
sleep 4 &amp;nbsp;# This due to concurrency, set some delay in order for the networking to be set up properly first&lt;/div&gt;
&lt;div&gt;
ifconfig eth0:0 192.168.0.111 netmask 255.255.255.0 broadcast 192.168.0.255&lt;/div&gt;
&lt;div&gt;
# or use below command to replace above ifconfig command&lt;/div&gt;
&lt;div&gt;
#&amp;nbsp;ip addr add 192.168.0.111 dev eth0&lt;/div&gt;
&lt;div&gt;
#################################&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The second workaround is, IMHO, better. No sleep hack necessary, since upstart script is used instead of rc.local script.&lt;/div&gt;
&lt;div&gt;
Create /etc/init/network-interface-virtual.conf (or use different name as you like), with the following lines inside:&lt;/div&gt;
&lt;div&gt;
#################################&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
description&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;configure virtual network device&quot;&lt;/div&gt;
&lt;div&gt;
respawn&lt;/div&gt;
&lt;div&gt;
console none&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
start on (net-device-up IFACE=eth0)&lt;/div&gt;
&lt;div&gt;
stop on runlevel [!12345]&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
script&lt;/div&gt;
&lt;div&gt;
exec ip addr add 192.168.0.111 dev eth0&lt;/div&gt;
&lt;div&gt;
# or use ifconfig command below&lt;/div&gt;
&lt;div&gt;
#&amp;nbsp;ifconfig eth0:0 192.168.0.111 netmask 255.255.255.0 broadcast 192.168.0.255&lt;/div&gt;
&lt;div&gt;
end script&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
#################################&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Reboot your system if necessary and everything is set and the virtual nic ip is ready to use. Oh, one more thing. There is also a bug (I think), which makes the virtual nic ip not showing with the ifconfig -a command. Just ping the virtual ip address to test whether it&#39;s up or not.&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/6704002058350874546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/01/ubuntu-1110-virtual-nic-ip-workaround.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/6704002058350874546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/6704002058350874546'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/01/ubuntu-1110-virtual-nic-ip-workaround.html' title='Ubuntu 11.10 Virtual NIC IP Workaround'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-8685336232967948196</id><published>2012-01-16T04:34:00.000-08:00</published><updated>2012-01-16T04:34:43.034-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="module"/><category scheme="http://www.blogger.com/atom/ns#" term="nic"/><category scheme="http://www.blogger.com/atom/ns#" term="r8168"/><category scheme="http://www.blogger.com/atom/ns#" term="r8169"/><title type='text'>Ubuntu 11.10 and Realtek (RTL8111/RTL8168) NIC driver problem</title><content type='html'>Finally, I figured out the problem that I had with network connection. The problem was with&amp;nbsp;Realtek (RTL8111/RTL8168) NIC, which somehow detected differently by ubuntu 11.10 and uses r8169 kernel module driver.&lt;br /&gt;
To be sure, do check your NIC using:&lt;br /&gt;
$ sudo lscpi&lt;br /&gt;
&lt;br /&gt;
You should see something like ...Realtek (RTL8111/RTL8168)...&lt;br /&gt;
Next step is to remove the r8169 module using:&lt;br /&gt;
$ rmmod r8169&lt;br /&gt;
&lt;br /&gt;
If necessary install&amp;nbsp;build-essential, etc:&lt;br /&gt;
$ sudo apt-get install build-essential linux-headers-$(uname -r) linux-source&lt;br /&gt;
&lt;br /&gt;
Then, download the proper driver for that particular NIC from&amp;nbsp;&lt;a href=&quot;http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&amp;amp;PNid=13&amp;amp;PFid=5&amp;amp;Level=5&amp;amp;Conn=4&amp;amp;DownTypeID=3&amp;amp;GetDown=false#2&quot;&gt;here&lt;/a&gt;. The file name should be something like r8168-8.027.00.tar.bz2.&lt;br /&gt;
Uncompress the file, and run the shell script file, as root:&lt;br /&gt;
# ./autorun.sh&lt;br /&gt;
&lt;br /&gt;
Check the newly compiled driver:&lt;br /&gt;
&lt;br /&gt;
$ sudo lsmod | grep r8168&lt;br /&gt;
$ ifconfig -a&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Blacklist the r8169 module driver, by editing /etc/modprobe.d/blacklist.conf, add:&lt;br /&gt;
#blacklist r8169 driver&lt;br /&gt;
blacklist r8169&lt;br /&gt;
&lt;br /&gt;
Reboot your system if necessary.</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/8685336232967948196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2012/01/ubuntu-1110-and-realtek-rtl8111rtl8168.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8685336232967948196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8685336232967948196'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2012/01/ubuntu-1110-and-realtek-rtl8111rtl8168.html' title='Ubuntu 11.10 and Realtek (RTL8111/RTL8168) NIC driver problem'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-8971791547242310134</id><published>2011-12-21T06:57:00.000-08:00</published><updated>2011-12-22T16:48:41.591-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="netcat"/><category scheme="http://www.blogger.com/atom/ns#" term="testing"/><category scheme="http://www.blogger.com/atom/ns#" term="web server"/><title type='text'>netcat as WebServer</title><content type='html'>I needed to have a (dummy) web server which gives only 201 CREATED response, for testing purpose. Instead of using real web server, I found a simpler way to achieve that. Using &lt;a href=&quot;http://netcat.sourceforge.net/&quot;&gt;netcat&lt;/a&gt;&amp;nbsp;like the following is enough for me to do some testing on my programs.&lt;br /&gt;
&lt;br /&gt;
$ nc -C -l 8080 -q 1 &amp;lt;&amp;lt; EOF&lt;br /&gt;
HTTP/1.0 201 CREATED&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
EOF&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/8971791547242310134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/12/netcat-as-webserver.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8971791547242310134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/8971791547242310134'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/12/netcat-as-webserver.html' title='netcat as WebServer'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-14514336929199397</id><published>2011-11-26T18:54:00.001-08:00</published><updated>2011-11-26T19:14:00.569-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="api"/><category scheme="http://www.blogger.com/atom/ns#" term="apikeyauthentication"/><category scheme="http://www.blogger.com/atom/ns#" term="django-tastypie"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="restful"/><category scheme="http://www.blogger.com/atom/ns#" term="urllib"/><category scheme="http://www.blogger.com/atom/ns#" term="urllib2"/><category scheme="http://www.blogger.com/atom/ns#" term="web service"/><title type='text'>Interacting with Django Tastypie API Using Python Librarys</title><content type='html'>If you already have some django web-app, consider extending its functionality with &lt;a href=&quot;https://github.com/toastdriven/django-tastypie&quot;&gt;django-tastypie&lt;/a&gt;. It has pretty decent &lt;a href=&quot;http://django-tastypie.readthedocs.org/en/latest/index.html&quot;&gt;docs&lt;/a&gt; as well. With django-tastypie you can create RESTful Web Service. I am not going to talk about django-tastypie in this post, instead I would like to share how to interact with django-tastypie api using python&#39;s urllib and urllib2 libraries.&lt;br /&gt;
&lt;br /&gt;
The following codes gives some idea about how to get data using the API, with ApiKeyAuthentication method.&lt;br /&gt;
&lt;br /&gt;
import urllib, urllib2&lt;br /&gt;
&lt;br /&gt;
api_url = &#39;http://localhost:8080/api/app1/model1/?username=apiuser1&amp;amp;api_key=apikey_for_apiuser1&#39;&lt;br /&gt;
http_req = urllib2.Request(api_url, headers={&#39;ACCEPT&#39;: &#39;application/json, text/html&#39;})&lt;br /&gt;
try:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; resp = urllib2.urlopen(http_req)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; contents = resp.read()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print contents&lt;br /&gt;
except urllib2.HTTPError, error:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print he.getcode()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes below gives some idea about how to create data using the API, with ApiKeyAuthentication method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
import urllib, urllib2&lt;br /&gt;
import simplejson as json&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
api_url = &#39;http://localhost:8080/api/app1/model1/?username=apiuser1&amp;amp;api_key=apikey_for_apiuser1&#39;&lt;br /&gt;
json_post = json.dumps({&quot;model_name&quot;: &quot;TEST13&quot;})&lt;br /&gt;
http_req = urllib2.Request(api_url,&amp;nbsp;json_post, {&#39;Content-Type&#39;: &#39;application/json&#39;, &#39;ACCEPT&#39;: &#39;application/json, text/html&#39;})&lt;br /&gt;
try:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;response = urllib2.urlopen(http_req)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print&amp;nbsp;response.read()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print&amp;nbsp;response.getcode()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print&amp;nbsp;response.info()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print&amp;nbsp;response.msg&lt;br /&gt;
except urllib2.HTTPError as he:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print he.getcode()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print he.info()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print he.msg&lt;br /&gt;
except urllib2.URLError as ue:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print ue&lt;br /&gt;
&lt;br /&gt;
Both examples using json data format. Remember to set the appropriate Content-Type and ACCEPT header data if using different data format.&lt;br /&gt;
If it is&amp;nbsp;necessary&amp;nbsp;to use https secure connection and proxy, refer to &lt;a href=&quot;http://murzal-arsya.blogspot.com/2011/11/python-https-post-data-over-proxy.html&quot;&gt;this post&lt;/a&gt; to get more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/14514336929199397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/interacting-with-django-tastypie-api.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/14514336929199397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/14514336929199397'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/interacting-with-django-tastypie-api.html' title='Interacting with Django Tastypie API Using Python Librarys'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-2434891157821520774</id><published>2011-11-26T04:52:00.001-08:00</published><updated>2011-11-26T05:20:21.379-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="centos"/><category scheme="http://www.blogger.com/atom/ns#" term="distribute"/><category scheme="http://www.blogger.com/atom/ns#" term="large file"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mirror"/><category scheme="http://www.blogger.com/atom/ns#" term="network"/><category scheme="http://www.blogger.com/atom/ns#" term="robocopy"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="sync"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Distributing Large Files - Implementation Part 1</title><content type='html'>This post is related to my previous post about distributing large files&amp;nbsp;&lt;a href=&quot;http://murzal-arsya.blogspot.com/2011/11/distributing-large-files.html&quot;&gt;http://murzal-arsya.blogspot.com/2011/11/distributing-large-files.html&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Finally I implemented my distribution strategy as I explained in my previous post. Let me give a little bit info about the infrastructure.&lt;br /&gt;
&lt;br /&gt;
1 Server:&lt;br /&gt;
Brand/Type: IBM System x3650 M3&lt;br /&gt;
OS: Centos 6&lt;br /&gt;
Service: Samba&lt;br /&gt;
NIC: 2 Gigabit&lt;br /&gt;
&lt;br /&gt;
1 Switch: HP Procurve 1810 24g (Gigabit)&lt;br /&gt;
&lt;br /&gt;
10 Clients:&lt;br /&gt;
Brand/Type: HP Pavilion HPE&lt;br /&gt;
OS: Windows 7&lt;br /&gt;
Apps: QGIS&lt;br /&gt;
NIC: 1 Gigabit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have samba configured as shared storage. Within the share folder I put the large image files to be distributed to the clients.&amp;nbsp;My strategy is creating a chain distribution, from the Server to PC-01, PC-01 to PC-02, and so on, until PC-10. I choose robocopy for its simplicity and it does the job well.&lt;br /&gt;
So, I created a batch file&lt;br /&gt;
&lt;br /&gt;
Since I need to access the shared folder, I need to make sure that the connection could be established using correct user for authentication. In order to do that, before I run robocopy, I use net use command for authenticating.&lt;br /&gt;
&amp;gt;net use \\SERVER\share_images /USER:user1 password1&lt;br /&gt;
then I could execute robocopy with something like the following:&lt;br /&gt;
&amp;gt;robocopy /E /PURGE /COPY:DAT \\SERVER\share_images C:\images&lt;br /&gt;
&lt;br /&gt;
The most ideal way to trigger the synchronization is when there is change in each share folder, and&amp;nbsp;queuing the sync processes when there are multiple changes detected.&amp;nbsp;It is beyond the scope of this post.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/2434891157821520774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/distributing-large-files-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/2434891157821520774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/2434891157821520774'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/distributing-large-files-implementation.html' title='Distributing Large Files - Implementation Part 1'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-6192270317846163301</id><published>2011-11-20T16:09:00.001-08:00</published><updated>2011-11-20T17:07:09.678-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="https"/><category scheme="http://www.blogger.com/atom/ns#" term="post"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="urllib"/><category scheme="http://www.blogger.com/atom/ns#" term="urllib2"/><title type='text'>Python HTTPS POST Data Over Proxy</title><content type='html'>Posting HTTPS POST data over proxy is pretty simple in python. Everything is done mostly with urllib2. The only thing that is done outside urllib2 is when encoding the POST data, which uses urllib.urlencode.&lt;br /&gt;
Here is an example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
import urllib, urllib2&lt;br /&gt;
&lt;br /&gt;
PROXY = urllib2.ProxyHandler({&#39;https&#39;: &#39;http://your_proxy:your_proxy_port/&#39;})&lt;br /&gt;
PROXY_OPENER = urllib2.build_opener(PROXY)&lt;br /&gt;
urllib2.install_opener(PROXY_OPENER)&lt;br /&gt;
&lt;br /&gt;
URL = &#39;https://www.post-test-site.com/post.php&#39;&lt;br /&gt;
POST = {&#39;data1&#39; : &#39;Your Data1&#39;, &#39;data2&#39; : &#39;Your Data2&#39;}&lt;br /&gt;
&lt;br /&gt;
POST_DATA = urllib.urlencode(POST)&lt;br /&gt;
HTTPS_REQ = urllib2.Request(URL, POST_DATA)&lt;br /&gt;
RESP = urllib2.urlopen(HTTPS_REQ)&lt;br /&gt;
OUTPUT = RESP.read()&lt;br /&gt;
&lt;br /&gt;
print OUTPUT&lt;br /&gt;
&lt;br /&gt;
When your proxy needs authentication, then you need to use:&lt;br /&gt;
urllib2.HTTPBasicAuthHandler and/or&amp;nbsp;urllib2.HTTPPasswordMgrWithDefaultRealm&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/6192270317846163301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/python-https-post-data-over-proxy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/6192270317846163301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/6192270317846163301'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/python-https-post-data-over-proxy.html' title='Python HTTPS POST Data Over Proxy'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-6186917557825152383</id><published>2011-11-15T21:02:00.001-08:00</published><updated>2011-11-17T05:27:46.069-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dhcp"/><category scheme="http://www.blogger.com/atom/ns#" term="network interface"/><category scheme="http://www.blogger.com/atom/ns#" term="nic"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><title type='text'>Configure DHCPd to Work on Certain NIC(s)</title><content type='html'>Your server has more than one network interfaces and you need DHCP server to associated with only one of them.&lt;br /&gt;
&lt;br /&gt;
Here is how you configure it on Ubuntu:&lt;br /&gt;
&lt;br /&gt;
# File: /etc/default/dhcp3-server&lt;br /&gt;
INTERFACES=&quot;eth0&quot;&lt;br /&gt;
or&lt;br /&gt;
INTERFACES=&quot;eth0 eth1&quot;&lt;br /&gt;
&lt;br /&gt;
Onn Redhat/Fedora/Centos:&lt;br /&gt;
# File: /etc/sysconfig/dhcpd&lt;br /&gt;
DHCPDARGS=eth1&lt;br /&gt;
or&lt;br /&gt;
DHCPDARGS=&quot;eth0 eth1&quot;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Reference:&lt;br /&gt;
&lt;a href=&quot;http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-dhcp-configuring-server.html&quot;&gt;http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-dhcp-configuring-server.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/6186917557825152383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/configure-dhcpd-to-work-on-certain-nics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/6186917557825152383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/6186917557825152383'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/configure-dhcpd-to-work-on-certain-nics.html' title='Configure DHCPd to Work on Certain NIC(s)'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-3292299975613247224</id><published>2011-11-12T06:01:00.001-08:00</published><updated>2011-11-13T05:14:43.934-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="centos"/><category scheme="http://www.blogger.com/atom/ns#" term="distribute"/><category scheme="http://www.blogger.com/atom/ns#" term="large file"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="network"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Distributing Large Files</title><content type='html'>One of the requirements of my new project is to be able to distribute large files to 10-15 clients as fast as possible. Fortunately, all (server and clients) NICs supports Gigabit connectivity.
&lt;br /&gt;
I tested it first simply by copying large data from server to many clients simultaneously. Of course, it was a disaster. While theoretically the copying speed would decrease proportional to the number of clients, in reality the network connection between clients and server, and also between clients got disrupted. Network was down for sometimes. I did not make any further investigation on what was happening, all I know is this is far from the desired speed even if it was going well.
&lt;br /&gt;
What&#39;s next? I gather some info&#39;s on how to distribute large files over LAN. Some suggest bittorrent, parallel filesystem, multicast copy, (win) mesh, and some other way.
My concern is that I have to use a solution which is as simple as possible, since there would not be any expert IT guy around in the future.
&lt;br /&gt;
While bittorrent sounds pretty promising, I had to leave out this option. Not only because of the capability of the human resources that will maintain the system, also it would take some times to prepare the large file to be distributed by bittorrent. Another thing is that small torrent packets could really saturate the network.
&lt;br /&gt;
&lt;br /&gt;
About parallel filesystem, I have to ditch this one too, because this would be more complicated and confusing for the basic admin guy. Also I need to mention that all clients are Windows 7, not really sure there are stable parallel filesystem support
&lt;br /&gt;
&lt;br /&gt;
Multicast copy should be interesting, but could not find any apps for Windows 7.
&lt;br /&gt;
&lt;br /&gt;
So, I figured that I need to make my own simple solution. The goal here is to distribute large files, around 1-5 GigaBytes each, without overloading the connection between source (server) and target (pc).
&lt;br /&gt;
&lt;br /&gt;
I simply came up with creating some kind of chain distribution. Transfer file from Server to PC1, and from PC1 to PC2, and so on. Doing this, I could use all of the available incoming gigabit bandwidth as well as the outgoing one. I tested it and worked quite well.
Of course there will be a problem if one of the PC is down, then the distribution could not be continued to the rest of the PCs after that. So, rerouting must be done either manually or automatically.
&lt;br /&gt;
&lt;br /&gt;
As for the tool to copy the data, one can use simple copy, robocopy, synctoy, and other mechanism. I am planning to use command line robocopy.
&lt;br /&gt;
&lt;br /&gt;
I also plan to use load balancing technique using both NICs on the server. So, I can create 2 chains within the network, and perform the transfer simultaneously to those chains.</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/3292299975613247224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/distributing-large-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/3292299975613247224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/3292299975613247224'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/11/distributing-large-files.html' title='Distributing Large Files'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-6189585564213012852</id><published>2011-10-20T19:36:00.000-07:00</published><updated>2011-11-17T05:34:13.370-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="centos"/><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="fedora"/><category scheme="http://www.blogger.com/atom/ns#" term="network interface"/><category scheme="http://www.blogger.com/atom/ns#" term="nic"/><category scheme="http://www.blogger.com/atom/ns#" term="permanent configuration"/><category scheme="http://www.blogger.com/atom/ns#" term="redhat"/><category scheme="http://www.blogger.com/atom/ns#" term="speed"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Permanently Set Network Interface Speed, Duplex or Auto Negotiate Settings on Linux</title><content type='html'>&lt;br /&gt;
On RedHat (based) Linux:&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/ifcfg-eth0 file for eth0 interface.&lt;br /&gt;
On my Fedora15, the file looks like the following:&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-Auto_wlan&lt;br /&gt;
&lt;br /&gt;
So, open the corresponding file according to your need, then append the following line:&lt;br /&gt;
ETHTOOL_OPTS=&quot;speed 100 duplex full autoneg off&quot;&lt;br /&gt;
&lt;br /&gt;
Save the file, and restart network interface by executing the following command:&lt;br /&gt;
# /etc/init.d/network restart&lt;br /&gt;
&lt;br /&gt;
The previous example is for setting the NIC to 100Mbps, full duplex and no auto negotiation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want 1000Mbs use the following configuration:&lt;br /&gt;
ETHTOOL_OPTS=&quot;speed 1000 duplex full autoneg off&quot;&lt;br /&gt;
&lt;div&gt;
or&lt;/div&gt;
&lt;div&gt;
ETHTOOL_OPTS=&quot;speed 1000 duplex full autoneg on&quot;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For Ubuntu and perhaps Debian and other Debian based Linux, edit /etc/network/interfaces, and add pre-up statment, so it will look like something like the following:&lt;br /&gt;
&lt;br /&gt;
auto eth0&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
pre-up /usr/sbin/ethtool -s eth0 speed 1000 duplex full&lt;br /&gt;
&lt;br /&gt;
Refer to &lt;a href=&quot;https://help.ubuntu.com/11.04/serverguide/C/network-configuration.html&quot;&gt;this link&lt;/a&gt; for more information.&lt;br /&gt;
&lt;br /&gt;
For Ubuntu:&lt;br /&gt;
Edit&amp;nbsp;/etc/network/interfaces and add the following line:&lt;br /&gt;
pre-up /usr/sbin/ethtool -s $IFACE autoneg off 100 duplex full&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/6189585564213012852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/10/permanently-set-network-interface-speed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/6189585564213012852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/6189585564213012852'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/10/permanently-set-network-interface-speed.html' title='Permanently Set Network Interface Speed, Duplex or Auto Negotiate Settings on Linux'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-7408245670464568912</id><published>2011-10-18T17:49:00.000-07:00</published><updated>2011-10-18T18:06:59.753-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="centos"/><category scheme="http://www.blogger.com/atom/ns#" term="centos 6"/><category scheme="http://www.blogger.com/atom/ns#" term="ibm system x3650 m3"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu 10.04.3 LTS"/><title type='text'>IBM System x3650 M3 Disk Configuration</title><content type='html'>I just finished working with &lt;a href=&quot;http://www-03.ibm.com/systems/x/hardware/rack/x3650m3/&quot;&gt;IBM System x3650 M3&lt;/a&gt;. In the beginning, I had trouble with both Ubuntu Server 10.04.3 LTS and Centos 6 not detecting internal harddisks. Doing a little bit search, some informed that the problem is due to the driver, but that is not the case, since Ubuntu Server 10.04.3 LTS already have it.&lt;br /&gt;
&lt;div&gt;
Then I tried with Centos 6 and faced the same problem, no harddisk detected. Fortunately, I found some info in a forum mention about one need to configure the harddisk in the BIOS first. Aha. This is actually where the issue exist.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In order to configure the harddisks in the BIOS, just boot up the server and wait until a screen mention about Megaraid WebBIOS Configuration, press Ctrl-H.&lt;/div&gt;
&lt;div&gt;
Then, configure the harddisks as Array RAID. After that, just use Configuration Wizard to set them as as many Disk Group as needed. At this point, Centos 6 could detect the harddisk.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Find official guide from IBM, Installation and User&#39;s Guide - IBM ServeRAID-M Software (WebBIOS, MegaRAID Storage Manager, and MegaCLI),&amp;nbsp;&lt;a href=&quot;http://download.boulder.ibm.com/ibmdl/pub/systems/support/system_x_pdf/ibm_doc_sraidmr_software_4thedition_userguide.pdf&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/7408245670464568912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/10/ibm-system-x3650-m3-disk-configuration.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/7408245670464568912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/7408245670464568912'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/10/ibm-system-x3650-m3-disk-configuration.html' title='IBM System x3650 M3 Disk Configuration'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-1842679471265133362</id><published>2011-10-06T21:42:00.000-07:00</published><updated>2011-10-18T17:58:47.538-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="highcharts"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Highcharts Month Year X Axis Format</title><content type='html'>&lt;a href=&quot;http://www.highcharts.com/&quot;&gt;Highcharts&lt;/a&gt; is really awesome. If you need to neat looking charts, this is the answer.&lt;br /&gt;
&lt;br /&gt;
I faced a bit problem with setting the X Axis date format to stick with Month-Year format. That is because Highcharts automatically adjust the best possible date range. To maintain the date range to monthly (Month-Year format), is by using tick interval configuration.&lt;br /&gt;
To get monthly date range, set the tick interval to approximately one month, so the value is: 31* 24 * 3600 * 1000.&lt;br /&gt;
&lt;br /&gt;
If Highcharts&#39; &lt;a href=&quot;http://www.highcharts.com/license&quot;&gt;Licensing&lt;/a&gt; does not fit you, then take a look at &lt;a href=&quot;http://www.jqplot.com/&quot;&gt;jqPlot&lt;/a&gt;. Not as fancy as Highcharts, but in my opinion it&#39;s the best for totally free js charting solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/1842679471265133362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/10/highcharts-month-year-x-axis-format.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/1842679471265133362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/1842679471265133362'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/10/highcharts-month-year-x-axis-format.html' title='Highcharts Month Year X Axis Format'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-5253140052122539003</id><published>2011-10-06T21:12:00.000-07:00</published><updated>2011-10-18T17:59:12.910-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="django orm"/><category scheme="http://www.blogger.com/atom/ns#" term="group by"/><title type='text'>Django ORM Duplicate Group By Condition</title><content type='html'>I noticed that when using group by with Django ORM, the group by conditions are duplicated. Then I found more information about it in &lt;a href=&quot;https://code.djangoproject.com/ticket/15709&quot;&gt;here&lt;/a&gt;. Fortunately there is a &lt;a href=&quot;https://code.djangoproject.com/attachment/ticket/15709/15709.diff&quot;&gt;patch&lt;/a&gt;, and the &lt;a href=&quot;https://code.djangoproject.com/raw-attachment/ticket/15709/15709.diff&quot;&gt;diff file&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The patch should be applied to compiler.py module. On my Ubuntu 10.04 system it is located:&lt;br /&gt;
/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/db/models/sql/compiler.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/5253140052122539003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/10/django-orm-duplicate-group-by-condition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/5253140052122539003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/5253140052122539003'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/10/django-orm-duplicate-group-by-condition.html' title='Django ORM Duplicate Group By Condition'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-5134086648981440993</id><published>2011-09-16T12:12:00.000-07:00</published><updated>2011-10-18T17:59:32.986-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dlink"/><category scheme="http://www.blogger.com/atom/ns#" term="dns320"/><category scheme="http://www.blogger.com/atom/ns#" term="nas"/><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><title type='text'>Dlink DNS320 NAS as SVN Server</title><content type='html'>Continuing my&amp;nbsp;&lt;a href=&quot;http://murzal-arsya.blogspot.com/2011/09/dlink-dns320-nas.html&quot;&gt;previous post&lt;/a&gt;&amp;nbsp;about Dlink DNS320 NAS, I would like to share about making this NAS as SVN Server.&amp;nbsp;I am still amazed by this NAS and how handy and quite powerful it becomes, because I have Debian Squeeze installed and running on it. Once I have Debian Squeeze installed I could installed anything I need from the repositories. Please read my&amp;nbsp;&lt;a href=&quot;http://murzal-arsya.blogspot.com/2011/09/dlink-dns320-nas.html&quot;&gt;previous post&lt;/a&gt;&amp;nbsp;on how to install it on this NAS.&lt;br /&gt;
&lt;br /&gt;
Here is how I setup this NAS to become svn server.&lt;br /&gt;
&lt;br /&gt;
Create svn repos directory:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# apt-get update&lt;br /&gt;
# apt-get install subversion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# mkdir -p /var/svn/&lt;br /&gt;
&lt;br /&gt;
#&amp;nbsp;svnadmin create /var/svn/projectalpha&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add svn user and group:&lt;br /&gt;
# adduser --system --group --shell /usr/sbin/nologin --disabled-login svn&lt;br /&gt;
&lt;br /&gt;
Set the appropriate ownership for the repository directory:&lt;br /&gt;
# chown -R svn.svn /var/svn&lt;br /&gt;
&lt;br /&gt;
Add exisiting user to svn group so they will have access to the repo directory:&lt;br /&gt;
# useradd -G svn arsya&lt;br /&gt;
&lt;br /&gt;
Now set up an ssh server, clients will connect to this machine using ssh:&lt;br /&gt;
Set up ssh server if does not exist yet:&lt;br /&gt;
# apt-get install openssh-server&lt;br /&gt;
&lt;br /&gt;
Perform the following command to test via svn+ssh protocol:&lt;br /&gt;
$ svn co svn+ssh://username@hostname/var/svn/projectalpha&lt;br /&gt;
&lt;br /&gt;
Now, what if you have your ssh server running on custom port? How can you tell your svn client to use it?&lt;br /&gt;
&lt;br /&gt;
If you are using subversion, the one the you (apt-get) installed earlier, simply update your subversion configuration file in ~/.subversion/config:&lt;br /&gt;
[tunnels]&lt;br /&gt;
sshtunnel = ssh -p &lt;custom port=&quot;&quot;&gt;&lt;/custom&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are using tortoisesvn client in windows, then you need to go to&amp;nbsp;TortoiseSVN-&amp;gt;Settings-&amp;gt;Network and set the SSH client to:&lt;br /&gt;
C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe -P &lt;custom port=&quot;&quot;&gt;&lt;/custom&gt;&lt;br /&gt;
&lt;br /&gt;
Note that I do not need to install apache2 web server, since svn+ssh is enough for me to use. Also it would save some memory usage in this limited memory NAS.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/5134086648981440993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/09/dlink-dns320-nas-as-svn-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/5134086648981440993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/5134086648981440993'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/09/dlink-dns320-nas-as-svn-server.html' title='Dlink DNS320 NAS as SVN Server'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-885369486832911306</id><published>2011-09-15T17:44:00.000-07:00</published><updated>2011-10-18T18:00:34.556-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dlink"/><category scheme="http://www.blogger.com/atom/ns#" term="dns320"/><category scheme="http://www.blogger.com/atom/ns#" term="nas"/><title type='text'>DLink DNS320 NAS with Extended Services</title><content type='html'>DLink DNS320 NAS is quite awesome, because it is quite affordable and one can hack it to make it as even more useful than what it already is.&lt;br /&gt;
&lt;br /&gt;
This NAS sports a Marvell Kirkwood processor with 128MB RAM, here is technical details of it:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table class=&quot;inline&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-collapse: collapse; color: black; font-size: 13px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th style=&quot;background-color: #dee7ec; border-bottom-color: rgb(140, 172, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(140, 172, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(140, 172, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(140, 172, 187); border-top-style: solid; border-top-width: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;CPU&lt;/th&gt;&lt;td style=&quot;border-bottom-color: rgb(140, 172, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(140, 172, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(140, 172, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(140, 172, 187); border-top-style: solid; border-top-width: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;800&amp;nbsp;&lt;acronym style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(0, 0, 0); border-bottom-style: dotted; border-bottom-width: 1px; color: black; cursor: help;&quot; title=&quot;Megahertz&quot;&gt;MHz&lt;/acronym&gt;&amp;nbsp;Marvell 88F6281 (Kirkwood)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th style=&quot;background-color: #dee7ec; border-bottom-color: rgb(140, 172, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(140, 172, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(140, 172, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(140, 172, 187); border-top-style: solid; border-top-width: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;RAM&lt;/th&gt;&lt;td style=&quot;border-bottom-color: rgb(140, 172, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(140, 172, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(140, 172, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(140, 172, 187); border-top-style: solid; border-top-width: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;128&amp;nbsp;&lt;acronym style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(0, 0, 0); border-bottom-style: dotted; border-bottom-width: 1px; color: black; cursor: help;&quot; title=&quot;Megabyte&quot;&gt;MB&lt;/acronym&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th style=&quot;background-color: #dee7ec; border-bottom-color: rgb(140, 172, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(140, 172, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(140, 172, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(140, 172, 187); border-top-style: solid; border-top-width: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;USB&lt;/th&gt;&lt;td style=&quot;border-bottom-color: rgb(140, 172, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(140, 172, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(140, 172, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(140, 172, 187); border-top-style: solid; border-top-width: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;1 USB2.0 Port (front)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th style=&quot;background-color: #dee7ec; border-bottom-color: rgb(140, 172, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(140, 172, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(140, 172, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(140, 172, 187); border-top-style: solid; border-top-width: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;LAN&lt;/th&gt;&lt;td style=&quot;border-bottom-color: rgb(140, 172, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(140, 172, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(140, 172, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(140, 172, 187); border-top-style: solid; border-top-width: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;Marvell 88E1118R-NNC1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
To get more info please go&amp;nbsp;&lt;a href=&quot;http://wiki.dns323.info/dns-320&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Looking at that spec, one can get tempted to figure out a way to turn it into not just a Storage Server. Fortunately there is a way to extend the functionality by using fun_plug. Fun_plug makes installing other services so easy. &lt;a href=&quot;http://wiki.dns323.info/dns-320#setting_up_ffp&quot;&gt;Here&lt;/a&gt;&amp;nbsp;and &lt;a href=&quot;http://nas-tweaks.net/40/installation-of-the-fonz-funplug-0-5-for-ch3snas-ch3mnas-dns-323-and-many-more/&quot;&gt;here&lt;/a&gt; contains more detail about setting it up in DNS320. Please install fun_plug (ffp) before installing Debian Squeeze. Make sure you use &lt;a href=&quot;http://wolf-u.li/u/171/&quot;&gt;this&lt;/a&gt;&amp;nbsp;ffp script for DNS320, otherwise you will receive errors.&lt;br /&gt;
&lt;br /&gt;
For me it is not enough, since I know that there is a way to install Debian Squeeze in it and chroot it automagically. Now this is amazing, because you have a full blown debian linux distro running inside your NAS.&lt;br /&gt;
What you need is to download Debian Squeeze &lt;a href=&quot;ftp://ftp.dlink.pl/dns/dns-320/driver_software/DNS-320%26325_linuxDebian_revA_Squeeze_all_en_20110111.zip&quot;&gt;here&lt;/a&gt;. Then store it in the root of your nas, normally called Volume_1. Follow the readme inside the archive.&lt;br /&gt;
&lt;br /&gt;
Once Debian Squeeze installed, you can install ntp daemon, web server, svn server, download manager, and other stuff. The only limitation is the size of RAM.&lt;br /&gt;
&lt;br /&gt;
Oh, I need to inform you that installing fun_plug and Debian Squeeze is totally safe and reversible, because no ROM Flashing involved. So, what are you waiting for?!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/885369486832911306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/09/dlink-dns320-nas.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/885369486832911306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/885369486832911306'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/09/dlink-dns320-nas.html' title='DLink DNS320 NAS with Extended Services'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1093052595864541863.post-7646147035200283675</id><published>2011-09-15T17:19:00.000-07:00</published><updated>2011-10-20T19:37:47.938-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="db transaction"/><category scheme="http://www.blogger.com/atom/ns#" term="django orm"/><category scheme="http://www.blogger.com/atom/ns#" term="speed up"/><title type='text'>Django ORM DB Transactions to Speed Up Bulk Insert</title><content type='html'>Using Django means you are bounded to Django ORM. Of course one can use other DB ORM, but then loose many neat features in django, such as admin interface and model forms. Lots of tinkering around required when not using Django ORM.&lt;br /&gt;
I had a problem when inserting many data using Django ORM. The performance was unacceptably slow. Just to insert 30 data requires more than 10 seconds. How about inserting 50, 100 or more. That is because each time I called save method in the model, Django ORM will execute and commit it immediately, and resulted in performance issue.&lt;br /&gt;
Luckily there is a&amp;nbsp;a way to speed up large number of data insert. Django provides a way to manage database transaction, and the way to use it is pretty simple. What we need is&amp;nbsp;TransactionMiddleware. Autocommit is used by default by the transaction manager. In order to speed things up, we need to change it to commit only on succes, simply by using commit_on_succes decorator for the related view.&lt;br /&gt;
&lt;br /&gt;
Now, you need to have TransactionMiddleware registered in settings.py, so it will look like the following:&lt;br /&gt;
&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &#39;django.middleware.transaction.TransactionMiddleware&#39;,&lt;br /&gt;
...&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, you can use it in your views.py like the following:&lt;br /&gt;
&lt;br /&gt;
from django.db import transaction&lt;br /&gt;
&lt;br /&gt;
@transaction.commit_on_success&lt;br /&gt;
def viewfunc(request):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; # ...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; # this code executes inside a transaction&lt;br /&gt;
&amp;nbsp; &amp;nbsp; # ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By doing that, if the function returns successfully, then Django will commit all work done within the function at that point. If the function raises an exception, though, Django will roll back the transaction. All of those means faster performance.&lt;br /&gt;
&lt;br /&gt;
Please refer to&amp;nbsp;&lt;a href=&quot;https://docs.djangoproject.com/en/1.3/topics/db/transactions/&quot;&gt;here&lt;/a&gt;&amp;nbsp;for more details about django transaction management.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://murzal-arsya.blogspot.com/feeds/7646147035200283675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murzal-arsya.blogspot.com/2011/09/django-orm-db-transactions-to-speed-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/7646147035200283675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1093052595864541863/posts/default/7646147035200283675'/><link rel='alternate' type='text/html' href='http://murzal-arsya.blogspot.com/2011/09/django-orm-db-transactions-to-speed-up.html' title='Django ORM DB Transactions to Speed Up Bulk Insert'/><author><name>Murzal Arsya</name><uri>http://www.blogger.com/profile/00432117049826596762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_hxOE8ECFOJg/Sim9WIiQhWI/AAAAAAAAAAM/MpA6J-Jcmg0/S220/presence_online.png'/></author><thr:total>0</thr:total></entry></feed>