Skip to main content

Posts

Luggage Security alarm

For my Electronics circuit and design lab project in my 4th sem, I had submitted the following project. The device here has quite limited functionality. The device is not a smart device or an IOT device as we were asked not to use any microcontrollers. We were required to make a device using only basic electronic components. So here's the synopsis : Synopsis for the Luggage Security Alarm Project   
Recent posts

Generate SSH keys on linux

My work often requires me to use git and github for version control. So when you first clone a repository to your local hdd , you are required to enter your github username and password everytime when you want to push stuff to that repo. This can be quite cumbersome for someone like me who prefers to push stuff quite often. (as the old adage goes,' It's better to be safe than sorry') A better way is to use ssh keys to authenticate your local machine so that you can skip the verification everytime when you push stuff. The way to do this is to use ssh when cloning the repo in the first place. When you click on the dropdown button 'Clone or download' on github, you're given the options to clone using https and ssh. Choose ssh to clone. Then on your local machine fire up the terminal (press ctrl+alt+t). change to your home directory(cd ~) and type in the following command : ssh-keygen -t rsa -C "your@email.here" This will generate the ssh

Simple Python HTTP Server on Linux

Sometimes we need to share files and folders quickly. Often emailing stuff to people tends to be cumbersome. I have noticed that creating a simple http server comes in really handy in such scenarios. Fortunately in linux, it's really simple to create a http server with Python if you don't want to mess around with apache or the likes. All it takes is a single line of code. Okay, let's cut to the chase. Here's how you do it : 1.Change your pwd to the folder that you would like to share cd /home/some_directory 2.Once you have done that, type in the following: sudo python -m SimpleHTTPServer 80 This will create a http server at port 80 and you will get the following message : Serving HTTP on 0.0.0.0 port 80 ... Now open a browser and type http://192.168.1.2:80 assuming that your ip address is 192.168.1.2 Press ctrl+c to stop the server

What does sudo apt-get autoremove do ?

sudo apt-get autoremove Whenever you install an application (using  apt-get ) the system will also install the software that this application depends on. It is common in Ubuntu/Linux that applications share the same libraries. When you remove the appplication the dependency will stay on your system. So  apt-get autoremove  will remove those dependencies that were installed with applications and that are no longer used by anything else on the system.

Useful linux commands

chmod  is the command and system call which may change the access permissions to file system objects (files and directories). It may also alter special mode flags. The request is filtered by the umask. The name is an abbreviation of  change mode . ls  is used to list files ps a  is used to list the processes running shutdown now  is used to shutdown the system sudo service lightdm  restart  used to log out from the current user sudo add-apt-repository ppa:<ppa_name>

How to install .run files ?

Occasionally, some applications and games (eg. some from the Humble Indie Bundle) have .run installers. Before installing using these, check to see if: it is available from the Software Centre it is available as a .deb file, which will open in the Software Center You can install .run files from the graphical interface, but using a terminal is more likely to give you useful feedback. To install a .run file you need to: make it executable. execute it This is because .run files are just executable programs that do some unknown magic to install the program. This is similar to what .exe installers do on Windows and is different to the normal methods (at best, using the Software Centre, at worst using .deb files) in which applications are installed in a standard way and can be easily removed. Graphical Method Right click on the file in the file manager and click 'Properties'. Click the 'Permissions' tab and tick the box that says 'Allow executing fil