Recent posts


Analysing ssh traffic usage per user

Posted on 19 Apr 2015

I often use my computer as a router. My friends would login to my system via ssh, and use the internet. Sometimes, its the opposite, that is, I login to their system to access the internet. But most of the time, its me who act as a router for others, as a internet gateway. The problem I only give ssh account to few of my close friends. I expect them to use internet only for browsing and not for downloading heavy stuff. But sometimes they would download heavy stuff and that would drastically affect my internet experience. I don’t want to cut everyone’s ssh access. It would have been great if I could somehow know which user is eating up my bandwidth, and then warn or deny his ssh access. Solution I googled about if there is any existing tool that would suffice my requirements. I found few interesting tools like iftop but the problem with most of them was that they don’t map users with the session. They could only tell me the traffic mapping to any particular ip addresses. Then, I came across this blog post by someone which made use of iptables to log the traffic. Again,...

Read more...

Goodbye proxychains !

Posted on 18 Feb 2015

I have this weird, not so straight mechanism to use Internet. I have a server in the Internet/Cloud that I am almost always logged in. I use this server to create a SOCKS proxy on my local and then use Internet via this SOCKS proxy. And then I would use proxychains or proxychains-ng or tsocks with each of the program I want to use Internet for. This is a bit messy setup but somehow I make everything work by using these combination of tools. These tools help resolve the DNS requests made by the program on the remote because my local DNS server doesn’t resolve DNS requests pertaining to Internet. Recently I found a wonderful tool i.e sshuttle, this tool would dynamically change your iptables and would make your computer access Internet if you have a setup like me, i.e you have a server in the Internet and you want to use Internet via this server on your local computer. You would then set your computer to use no proxy and it works because it has changed your iptables, all your packets, DNS requests are being routed through the server and your application doesn’t even know about what’s going on...

Read more...

Transforming Control flow to Data flow

Posted on 13 Feb 2015

This is in continuation to my earlier introductory post on Spatial Computing project I have been working on. I spent my last few days transforming the traditional control flow of the programs into a data flow graph having producer consumer relationship between the instructions. As mentioned in my previous post, this data flow when executed on a data flow architecture that we have been trying to build for ASICs and then later for general purpose computers would be using the highest level of parallelism available because of the producer-consumer relationship between the instructions. There are some programming constructs which are hard to transform from sequential to data flow. Loops, pointers, pointers to functions are some of them that needs extensive care. This post is more about the results from my project. I will be showing the transformation for single loop just for the sake of simplicity : Sample Code int sum_single_loop (int a){ int sum = 0; for (int i = 0; i < a; i++) sum = sum + i; } I am making use of LLVM IR format, so I convert all the code in imperative languages which are having their LLVM front-end avilable, to LLVM IR format....

Read more...

Libreoffice headless comes to the rescue

Posted on 03 Feb 2015

During exam time, I often have to read a lot of .ppt files provided to me by our instructors. That’s what we are supposed to study so that sylabii can be revised quickly. I don’t use windows at all and hence have to use libreoffice for opening these presentation files but libreoffice is quite slow for me as compared to microsoft powerpoint. I don’t want to install Windows now just because of this purpose. However, I observed that pdfs can be opened comparitively faster than these .ppt files. Converting each ppt file to its pdf equivalent is a cumbersome task. Last week, I wanted to convert a bulk of .ppt files to their pdf equivalents and this is where Libreoffice headless came to my rescue, it helped me do a mass conversion with this following command : libreoffice --headless --convert-to pdf *.ppt This will convert all the ppt files in current directory to their pdf equivalents. If you don’t know what a headless means, it means that you don’t want the whole GUI thing to woke up and do stuff for you, that increases the performance by several folds such as in this case. We just want the conversion feature...

Read more...

Enabling user homedirs on Apache

Posted on 03 Feb 2015

In this I will be talking about enabling user home directories for user accounts on the server. I will talking specifically about CentOS since it is this OS that I am using on one of the server I am handling. As usual, we have to tweak little bit with selinux variables here as if your selinux is on, it will prevent apache from accessing user home directories, but first of all you need to enable the homedirs in apache configuration itself. Depending on your OS, apache configuration file name maybe different. In CentOS, following is the apache configuration file : /etc/httpd/conf/httpd.conf You need to look for mod_userdir.c ifmodule block and then comment the line that says UserDir disabled and make sure that line UserDir public_html is uncommented. You can rename this from public_html to any directory name you like but then make sure that your users have that same directory name in their home directory. You also need to restart the httpd server after this. Here it goes : sudo service httpd restart After this you need a selinux rule here, you need to allow userdir from selinux. sudo setsebool -P httpd_enable_homedirs true And there you go, usernames on the...

Read more...