Navigating on folder and files quick and easy


Have you ever had chance in your most busy day to realize that you always keep things doing over and over again at the same time? Asking your self that you used computer to make things easy and powerful? Well let me share to you the tools am I using and if you find this article incomplete, please comment and fill the gaps.

This time I won't demonstrate how to use every one of them coz it is really straightforward how to use it on their given documentation.


AUTOJUMP - Well due to its popularity, most people use it. It is easy to install and to use. Just keep in mind to check it's dependency package. 


FASD - This is just like autojump but I prefer this over autojump as for me it is much easier to use and I don't get confused on the keyword it uses to run in terminal. Also it has session and history of folder and files you interact with so they are blazing fast when using via SSH.

Link: https://github.com/clvv/fasd
Z - I never had a chance to use this mainly because I prefer to use fasd but yeah same purpose and function to autojump.




Now this is the bonus part, in case you are looking into something like complete package, totally old fashion but yet powerful having same features like fasd or autojump, below is you may want to check out.

FISH SHELL - This one is more way different than the tools I mentioned above but believe me it is worth trying on your machine. They also tutorials and great documentation. 




So hopefully you find this blog helpful. Cheers!

Viewing your folder and files permission Numerically

Have you ever been wondering if you could only view the folders and files permission same way like you what are doing in chmod command?


To tell you honest, I am not a good reader for this kind of format:

7 = 4+2+1 (read/write/execute)
6 = 4+2 (read/write)
5 = 4+1 (read/execute)
4 = 4 (read)
3 = 2+1 (write/execute)
2 = 2 (write)
1 = 1 (execute)


So I keep on searching on the web and let me share with you what I learned and found out. This procedure helps me a lot and save my day.

So let us get started.

Open your gedit and paste the code below:


#!/bin/bash



ls -lhF $1 | while read DATA

do

  case "${DATA:0:1}" in
  "-"|"d")
    PERM=$( echo "${DATA:1:9}" | sed 's/-/0/g;s/r/4/g;s/w/2/g;s/x/1/g' )
    P_US=$((${PERM:0:1}+${PERM:1:1}+${PERM:2:1}))
    P_GR=$((${PERM:3:1}+${PERM:4:1}+${PERM:5:1}))
    P_OT=$((${PERM:6:1}+${PERM:7:1}+${PERM:8:1}))
    DATA=$( echo "$DATA" | sed "s/${DATA:0:10}/${P_US}${P_GR}${P_OT}/" )
    echo "$DATA"
  ;;
  *)
    continue
  ;;
  esac
done

exit 0
#finis

Now your done. Save it as "showperm.sh" without quotes of course in safe place such as /home/[yourusername]/Documents/

Next we will create symbolic link so where ever you are in your folders, you can call it.

Open your Terminal ( ctrl + alt + t ). Go to: /usr/local/bin

I assume now your are in the bin directory. Now type this and modify the text you should alter as based on your system setup:

Syntax:
--------

ln -s [where your file reside] [where to put it]

Actual code using our example file name and folder structure:

ln -s /home/mark/Documents/showperm.sh /usr/local/bin/showperm

OR if you don't want it to rename and you are in bin folder

ln -s /home/mark/Documents/showperm.sh .

Once done. Your good to go.

In your Terminal, do this:

showperm /home/mark/

And the expected output:

755  2 mark mark 4.0K Oct  3 17:13 Desktop/
755 10 mark mark 4.0K Oct  3 08:11 Documents/
755 23 mark mark  16K Oct  3 17:13 Downloads/
755  2 mark mark 4.0K Sep 20 09:15 Music/
755  2 mark mark 4.0K Sep 23 10:06 Pictures/
755  5 mark mark 4.0K Sep 29 11:19 Videos/

Now see the most left? It is now 755 instead of seeing drwxr-xr-x

Hope you enjoy and please feel free to comment below.

Cheers!

Manage almost everything in your OS in browser using webmin


Have ever wonder hoping you can manage your OS in once place? Or maybe your using a hosting provider with root access or maybe on the cloud service sick of doing lots of commands just to view and manage things? Well if that is the case, then webmin is the right solution for you.


So on this tutorial, we will use Ubuntu 12.04 'precise' as our OS and I will tell you how to install it.


Before we install webmin, please make sure you have the following packages installed in your machine:

perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 

If not, go ahead and paste this code. If you have either installed one of the packages, then feel free to edit removing installed package in your OS:sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 



If yes, then copy and paste this to your terminal:

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.580_all.deb


You can also check the URL as maybe by the time you read my article, there is a new updated version of webmin.

Once you done downloading it, let us install it in your machine. Make sure you are still on the same folder where you download the webmin.

sudo dpkg -i webmin_1.580_all.deb

Once done your ready to go. But before we proceed, I am hoping you did not yet close your terminal but if yes, I have remedy to it. Why maybe you ask. This is because upon installing, it will tell you what URL you have to navigate just like mine:

https://mark:10000/

But in case close it assuming are too much excited diving to your browser then just follow this format:

https:// ----> the protocol and this is constant
mark --------> the username of your PC. E.g. root@mark:#
:1000 -------> the port. This is constant

Now the problem was solved, go to your favorite browser and paste the link. You will prompt the username and password. The username is the root username and the password of course is the password of the root user.

Yeeehhaaa! your done baby. Hopefully you keep in mind, power requires responsibility and mind.

Just comment below if you have questions or maybe improvement to my post =)

View any website using Tor and select desire IP location by Country

Before we begin further, let us discuss what this TOR is all about and how it can help you with your desires and needs. 

TOR was original developed by US Naval as to become anonymous when viewing and visiting foreign sites and until it was put on public. The way it works is via relay. You are becoming anonymous because of the people sharing finger print and IP to you.

Installing TOR was no sweat at all. Just download the TOR bundle and you are ready to go. Although it doesn't stop there, because it can do a lot of things beyond your normal expectation usage as a normal guy. 

Checkout this site to download tor: https://www.torproject.org/download/download-easy.html.en


Now let us start diving to the original topic.

I assume that at this point, you are already downloaded and installed the TOR in your PC.

I won't waste your time and let us get started.

  1. First under Vidalia control panel of TOR, click "View the Network".
  2. Now you can see all people sharing and relaying with you
  3. On the left side, you can see the flag before their username
  4. Select your desire top 5 username and put it in a note making sure that the bandwidth connection is high.
  5. Now the most interesting part, right click the username, hover to copy then click "Fingerprint"
  6. Paste it in the note you desire and once you copy all of the "Fingerprint", it should looks like this:
    1. $4E377F91D326552AAE818D5A17BC3EF79639C2CD, $332895D092C2524A3CDE8F6E1498FFE665EBFC34, $83E7A68E9CDBA953CCF72A816B1F84E3A56B25BB, $E2B11C0812F9B32DE4EB60DCF56610280B817095, $D4E7812877860FBEB21AFC2F63BC10B68A0B8C06, $1FC841137C1F4C525D869B908E007D1D35727EF2, $358F99684C6AF99282C6909247CACF5B66DA947D
  7. Now once done, we will put few commands to read the TOR. So go ahead on your notepad again or whatever note application you use, do this assuming the above fingerprint is the one i will use:
    1. ExitNodes $4E377F91D326552AAE818D5A17BC3EF79639C2CD, $332895D092C2524A3CDE8F6E1498FFE665EBFC34, $83E7A68E9CDBA953CCF72A816B1F84E3A56B25BB, $E2B11C0812F9B32DE4EB60DCF56610280B817095, $D4E7812877860FBEB21AFC2F63BC10B68A0B8C06, $1FC841137C1F4C525D869B908E007D1D35727EF2, $358F99684C6AF99282C6909247CACF5B66DA947D  StrictExitNodes 1
  8. Once your note looks exactly like that aside from the fingerprint of course, on Vidalia Control Panel again, click "Settings".
  9. Now in the settings, go to "Advance" -> "Edit Current torrc"
  10. Once you are there, copy your notes ( Step 7 ) and paste it in the torrc. Paste it whenever you want to place it then highlight the one you paste, on the bottom part, click "Apply Selection Only" and click "Ok".
  11. Once your done doing the previous steps, disconnect your TOR including the firefox browser it loads up and reconnect again. Go to geoiptool.com or whatever website you prefer to check your IP and it should use the fingerprint of the users so selected.

NOTES:
--------

Since TOR relays depends on the users, do not expect that the users are always online. So maybe after a week or a month, you can't connect, either edit the torrc again and remove the Nodes connection of the fingerprint we added or select new users fingerprint again.


Hope you enjoy the tutorial. And sorry If I don't use images or screenshot, mainly because I don't want to load the site slow and I want you to read my post and blogs instead of relying on the screenshots.

Just Comment below if you have questions.

Cheers!

Downloading videos from different websites using movgrab

So yesterday in my previous post, regarding downloading videos from youtube. But what if you want to download not only from youtube but also from other websites? We'll this movgrab command line tool comes in handy. So far I am not sure how many sites it support as I can't find any documentation but you can try to download if it can.

However I as researched, here are the supported sites and the credit goes to webupd8.org:
  • YouTube
  • Metacafe
  • Dailymotion
  • Vimeo
  • Break.com
  • eHow
  • 5min.com
  • vbox7
  • blip.tv
  • Ted
  • MyVideo
  • ClipShack
  • MyTopClip
  • RedBalcony
  • Mobando
  • Yale University
  • Princeton University
  • Reuters
  • LiveLeak
  • Academic Earth
  • Photobucket
  • VideoEmo
  • VideosFacebook
  • Aljazeera
  • Mefeedia
  • IViewTube
  • Washington Post
  • CBS News
  • Euro News
  • MetaTube
  • MotionFeeds
  • Escapist
  • Guardian
  • RedOrbit
  • Sciive
  • Izlese
  • uctv.tv
  • royalsociety.tv
  • British Academy
  • Kitp
  • Dotsub
  • Astronomy.com
  • Teachertube.com
  • Discovery
  • Bloomberg.com

How to install it:
-------------------

For Ubuntu users and it's relatives:

Do this on terminal:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install movgrab

For other Linux repositories, you can compile it and as from the author says it has no dependencies and that is really cool.

So download the source on this URL: https://sites.google.com/site/columscode/home/movgrab as their official website for movgrab.

In terminal again:

./configure
make
sudo make install


Now let us do the climax:
-------------------------

In terminal again:

Syntax:

movgrab "URL"

Example:

movgrab "http://www.youtube.com/watch?v=cPNKJ_hmmsg"


In case you want to customize your download depending on your needs and preferences, I won't show everything so go ahead and see the manual or documentation in terminal.

In your terminal just type: man movgrab or movgrab -h


There you have it, enjoy downloading educational videos =)

Easy downloading videos from youtube in Terminal


So from now on forget about those fancy browser add ons just to download youtube to your computer. Using Terminal in linux, you can download any youtube you want just by typing few commands.

So lets get started. The following procedures may differ base on your Linux distro so pay attention to that.



For Ubuntu, Mint and relatives:
-------------------------------

  1. We were going to add first the repository. Copy and paste this command: sudo add-apt-repository ppa:nilarimogard/webupd8
  2. Update the repository via sudo apt-get update
  3. Let us now install youtube-dl just type sudo apt-get install youtube-dl



For CentOS, Fedora and its cousin and relatives:
-------------------------------------------------
  1. Enable epel repository
  2. Then type yum install youtube-dl


Now everything we need is installed, let us start downloading a video. For the purpose of this tutorial I'm going to download one of my favorite band and their song.

Type the following commands in your Terminal:

youtube-dl http://www.youtube.com/watch?v=CD-E-LDc384


So the syntax is :

youtube-dl [URL]


However that is not the end. Believe it or not you can do this more than that such as selecting the video format, resolution, downloading all type of format and even changing the filename.

Cool right? For more info, just check out their documentation or just type youtube-dl --help or youtube-dl -h or man youtube-dl

Resources: 
http://rg3.github.io/youtube-dl/

Thanks!

Download youtube video with youtube-dl

Posted on

Thursday, September 26, 2013

Category

,

,

,

,

Closing stuck up Program in Linux 101 using xkill and killall

Most of us including myself uses linux simply because of the following:
  1. You use Linux for development such as with LAMP
  2. You're running your own server
  3. You have old pc and Linux is the last OS option

We'll regardless of your reason, let me share to you what to do in case the application get stuck up and frozen. This case is very common to everyone.


There are two ways to do it:
---------------------------------
1. Via commands only in Terminal
2. Via commands in Terminal but using your mouse



How to do it:
---------------



Method 1 - xkill:
  • So press crtl+alt+t to open terminal or press alt+F2 and type gnome-terminal. 
  • Now type sudo xkill then notice your mouse cursor to see the awesomeness. From pointer, it will turn to have some x on it. 

Method 2 - killall:
  • So again just open your terminal.
  • Just simply type sudo killall [application]
  • The application is the name of the application you want to terminate. Best example is sudo killall chromium-browser

Cheers!