Wednesday, 24 June 2015

[Installation] Sublime Text in Linux!

Sublime Text : The text editor you'll fall in love with

 

Sublime Text is a sophisticated text editor for code, markup and prose. You'll love the slick user interface, extraordinary features and amazing performance. gedit has its own benefits : It comes by-default in Ubuntu, and its the first experience a novice gets of a text editor in Linux probably(no offense to anyone :P). But by time, you might get bored by the simpicity, and might need a beautiful and a little intelligent code editor. If that is the case, SublimeText is just for you!



Installation :
  1. As usual, you can go to www.sublimetext.com, and download the package suitable for your system : either a .deb for direct installation using apt or a .tar.bz2 file, which you can than extract and follow the instructions in the README.
  2. or, you can proceed via terminal as follows -
    (this askubuntu answer is very helpful!)
For Sublime-Text-2:
For Sublime-Text-3:

However, I am still not satisfied, since I am not able to run it using terminal, like I used gedit to. Unfortunately, Installation of ST doesn't automatically create the symbolic Link. So? We create a symbolic link for it.

For recent versions of Ubuntu and the latest SublimeText 3, the installation directory has changed slightly. We now find it sublime_text inside /opt/sublime_text instead of /opt/sublime. Hence the following command in terminal will do -

(If this doesn't work for you, you might wanna change /opt/sublime_text to /opt/sublime.)

Now I can edit any file using SublimeText by issuing command from terminal as subl mycode.java

Cheers!

Tuesday, 23 June 2015

[Solution] Speeding up Ubuntu 14.04 on a 1GB RAM

<Previous story

So, I had installed Linux Mint Nadia on my home PC and was running fine, but to our dismay, the distro was outdated and even it sources went 404 on apt-get update.
So, first I tried updating my sources.list file to old-releases.ubuntu.com using -

but then I gave up, since it was so tiring updating the whole thing on my end-of-the-billing-cycle broadband connection.

I just formatted the whole partition and began installing Ubu14.04 LTS on the same. This time, it somehow clicked that I had to press F11 to get to the boot options. It was enough, and Ubu was installed in somewhat 15 mins.

(c) Softpedia

I, however wasn't yet entitled to a breath of relief, since it was soon palpable that the system was lagging, and that too badly! Trust me, I was seeing the Window trails, the feature windows is famous for! (:P).

www.dansdata.com/images/io163/ie6trail.png

Anyhow, I had learned not to give up, atleast when it came for Linux and related products. This time this blog came to rescue. Reiterating the steps here that worked for me -
 (Refer to my next post for detailed explanation, here we've just noted reqd. points)

  1. First install gksu and leafpad, ignore if otherwise.
    sudo apt-get install gksu leafpad

  2. Now we'll check for current swappiness value :
    cat /proc/sys/vm/swappiness
  3. It would probably show 60. We would now be decreasing it to a more resonable value., say 10.
  4. Your machine might benefit from an even bigger decrease in swappiness. A useful rule of thumb might be this:
    1 GB RAM or more: swappiness at 10
    Less than 1 GB RAM: swappiness at 5
  5. Type gksudo leafpad /etc/sysctl.conf and make the following edit -
    #Decrease swappiness value
    vm.swappiness=10
     
  6. Now save the changes and reboot the system.
  7. After the system reboots, you'll notice the difference. However, to make sure you can reimplement Step 2, the swappiness will now show 10.

Now, all that was left was toning down the 3D-Graphics heavy Unity Desktop environment. I suggested him to use Gnome Fallback Session, since it would be the easiest, plus I kinda liked it. So - 
sudo apt-get install gnome-session-fallback
After installation, just Log out of current session. In the login window, click on the Ubu logo next to your username, and select Gnome flashback from the dropdown menu. Now login.

(c) /sites.google.com/site/easylinuxtipsproject/

Enjoy your new Ubu14.04 in your Home PC.

For more information, head on to -
https://rudd-o.com/linux-and-free-software/tales-from-responsivenessland-why-linux-feels-slow-and-how-to-fix-that
https://sites.google.com/site/easylinuxtipsproject/speed

Monday, 22 June 2015

[Solution] Forgot the username and password of the newly installed linux mint!

<Read story first

There are plenty of different procedures on the web for resetting the password of your linux distribution. As disparate as they seem, all of them work by logging into passwordless root shell. Following are the steps I gathered from sources and followed. Worked as a charm!

[Found out that these steps don't work if you have encrypted your home directory or whole system. Guess you need to encrypt every other thing out there to be secure]**

  1. Reboot your PC.
  2. Hold down the Shift key at the start of the boot process to enable the GRUB boot menu.
  3. Select the entry for your Linux installation (not the recovery-mode one)
  4. Then press e to edit.
  5. You'll see bunch of options for system-startup.
  6. Use the Arrow keys to navigate to a line that looks similar to this:

    linux /boot/vmlinuz-[kernel version]-generic root=UUID=[letters and numbers]\[letters and numbers] ro quiet splash vt.handoff=7
     
  7. Change ro quiet splash vt.handoff=7 to rw init=/bin/bash so it now reads:

    linux /boot/vmlinuz-[kernel version]-generic root=UUID=[letters and numbers]\[letters and numbers] rw init=/bin/bash

  8. Press F10 or Ctrl+X to boot your system.
  9. Your system will boot up to a passwordless root shell.
  10. Now, since I had forgotten the username, in my case, I first printed the list of users.
    Type cat /etc/passwd first to get a list of all users and note your username. In most cases, it is at the end.
  11. Type in passwd yourusername
  12. Set your new password.
  13. Restart your system.
It was a nice introduction my brother got of linux, without even using a mouse. I guess that was the whole purpose of Linux, we should be able to do everything via terminal. That's what I tell him, this is how perfect security is achieved, by perfect knowledge about the underlying things.

However, we ended up formatting mint the other day itself, and installed a super-slow-Ubu14.04 : #believe_me - it was worse than what Windows could ever get! The real task now was, to run the Ubu on the PC with 1GB ram and only 10gigs of Swap space. To know how to speed up the ubuntu system, and disabling the 3D graphics,  stay tuned for our next post!

Forgot the username and password of the newly installed linux mint!

Yes! you read it right.
It happened with my brother last night, when I was getting him started with the programming and the tech. he was about to begin his journey with. The beginning wasn't actually great. We had a PC at home with 1 GB RAM, and it already lagged pretty good for a 9-yr old PC. I had created a bootable USB* for installing Ubu-14.04* in dual boot with the existing Windows. So I asked him to empty a drive for the same purpose. Now, simply plugging in the usb and rebooting was required. After reboot, I was searching for boot device priority in the BIOS settings so that I could prioritize my USB, but somehow that option wasn't there! Luckily for us, I had previously installed mint via wubi, so I just selected to install mint dual-boot using Ubiquity*.

Things got pretty straight  from then on, and after almost half an hour, the installation was complete. However, when we were about to come to the interesting part - excited as we both were - my beloved brother forgot the login credentials - username to be precise. He was sure about the password as it was to be entered twice, but he failed to notice the username. This bit is also surprising, since afaik, linux installers don't autofill the usernames, but as my brother was saying, something surely had happened.

Now, Cinnamon login screens prefer a doubly secure login mechanism - it requires you to enter the username and password correctly in order to login. No such thing as guest login, or new user, or users list is available as is the case with ubuntu login. So, in short, it seemed that we got screwed. We might need - in worst case - to reinstall the mint from some other CD!
Image Credits - webupd8.org
Image Credits - webupd8.org
 Petrified as I was, I asked him to google how to do 'Forgot Password' for linux. Now, after his exams have got over, my brother has been really into his new android phone, carefully and deeply noticing every feature it has to provide. So he was ranting why there wasn't any option of password reset using Gmail account and all! Finally, we stumbled across a blogpost explaining the same.

I was unsure how to react - how will it help me recover my login credentials? I hadn't even used it for once, and heck I just knew one word - my passwd for sure. What did it mean for user security and privacy? I thought Linux was safe and couldn't be trespassed into. I was about to get surprised!






Mic testing.. one two three!

I am starting this blog for my everyday experiences with technology - the struggles, the solutions, some feelings (:P).
The posts might not be the best in resources for knowledge, but stumbling across a problem same as yours, and finding a solution might just be the best thing to lighten up your day.


Our favourite ©xkcd.com explains it beautifully.

I always wanted to have a platform where I can share about the daily struggle with tech, but I couldn't make it. Maybe it was the college environment, where I didn't get this much free time or whatever, it just couldn't perpetuate. Now I am out here, readying myself for the journey into real world, where not everything will be MATLAB or opencv or python or maybe, scarily enough, Linux.

Bless me for the perseverance.