notes

Reviving an old Samsung N150 Netbook and making it a solid Dev Environment

16 May 2018 - 4 minute read

I had an old Samsung N150 netbook lying around in my parent’s house. It was an amazing netbook and I remember fondly using it when my parents were not using it to browse the internet and sometimes even use it for school work. It came with Windows Vista if I recall correctly but I had installed Windows XP service pack 3 on it because as we know, Vista sucked! Well, the netbook was very solid, it even ran small games such as Fifa Manager etc and came with a solid keyboard, ethernet and VGA as well for connecting to a big screen.

Setting up Python on Spacemacs and using Pyenv to use Python3

21 Dec 2017 - 2 minute read
categories: foss notes tags: fedora python spacemacs

After diving into Spacemacs yesterday, I was able to setup LaTeX properly. Only SyncTeX is left to be setup although, right now I can live without it. After tweeting about it, I got a reply about setting up Python on Spacemacs. I had installed the python layer but had not tested it. There was no hitch, although I faced a small issue with having python2 as well as python3 on my system.

Setting up LaTeX on Spacemacs

20 Dec 2017 - 2 minute read
categories: notes tags: emacs foss latex linux spacemacs vim

I have been using Vim for text editing and even Vim mode even in Sublime Text. Although, I wanted to use Org mode so I switched to Spacemacs with Evil mode that gives the best of both worlds. I had been using TeXworks and TeXstudio for editing and building LaTeX documents but now that I have Emacs, I wanted to try out the pdf-tools layer and latex layers so that all my work can be done from inside Spacemacs itself.

yumex-dnf is locked

11 Oct 2017 - 1 minute read
categories: foss notes xfce

I downloaded a .rpm and double clicked it to install it and it started yumex-dnf. But for some reason it crashed and dnf was locked. I fixed it using yumex-dnf --exit and installed the rpm using sudo dnf install cacher-1.1.10.x86_64.rpm

Adding xfce4 Keyboard Shortcuts for Clementine or Spotify

20 May 2017 - 1 minute read

xfce4 has default media key settings for Pragha music player. Although, if you use clementine music player you can use keyboard shortcuts to control it with DBus and MPRIS. Clementine is known as org.mpris.clementine and you can add the following entries to your Keyboard Settings > Application Shortcuts If you use spotify, it is registered as org.mpris.MediaPlayer2.spotify on qdbus. qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.Next qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.Pause qdbus org.mpris.clementine /Player org.

Checking if a number is prime using Regex

12 Jan 2017 - 1 minute read
categories: notes tags: python regex

def is_prime(n): return not re.match(r'^.?$|^(..+?)\1+$', '1'*n) This works by first converting the number to unary, i.e. 5 will be ‘11111’ and 3 will be ‘111’ and so on. First, it tries to match 0 or 1 in the LHS and then uses backreferences to try and match multiples of 2, 3, 4 and so on until a match is found or string length is exceeded. For a deeper analysis please read: https://iluxonchik.

Notes on Regex

10 Jan 2017 - 2 minute read
categories: notes tags: notes python regex

I’m going to use python. Regex can be used by using the re library. You should not refer to this post as these are just notes, it would be better to follow the actual documentation of the library. To use regex, which uses backslashes \ we must use raw python strings like r"\n". . matches anything but a newline \d matches 0-9 while \D matches anything but digits. Similarly, \w matches word chars.

Author Biography Alongside Pictures in Latex

09 Nov 2016 - 1 minute read
categories: notes tags: latex

Some journal publications require you to put author biography for each author with their pictures. For this I found the _picins _package. To install this package you can run the following commands sudo mkdir /usr/share/texmf/tex/latex/picins sudo wget -O /usr/share/texmf/tex/latex/picins/picins.sty http://ctan.imsc.res.in/macros/latex209/contrib/picins/picins.sty http://mirrors.ctan.org/macros/latex209/contrib/picins/picins.sty sudo /usr/bin/texconfig rehash So, then you can use the following latex code for biography of an author: \parpic{\includegraphics[width=1in,clip,keepaspectratio]{figures/photo.eps}} \noindent {\bf Lorem Ipsum} dolor sit amet, consectetur adipiscing elit.

Share WiFi via Ethernet on Gnome 3.20

07 Aug 2016 - 1 minute read
categories: foss notes tags: fedora gnome linux

There is a hidden method to share your WiFi over Ethernet in the latest Gnome. I stumbled upon this while trying to connect my RaspberryPi 3B with my University’s Internet. Type nm-connection-editor in your terminal. Add a shared network connection by pressing the Add button. Choose Ethernet from the list and press Create. Click IPv4 Settings in the left. Choose Shared to other computers by clicking the Method drop-down menu.

Serverside and Clientside Redirection

23 Apr 2011 - 3 minute read
categories: notes tags: php js

Redirection can be achieved Server-Side or Client-Side. Redirection on client side involves the following steps: User requests a Page using an URI. Server sends a page based on that. That page will have JavaScript that will redirect user to another page. So, again server will get the request for the new page and then server will give response based on new request. That implies: Client-side -> Server-side -> Client-side -> Server-side -> Client-side.