September 2013

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!

Importing and Exporting MySQL Database via Cli


Reminders:

------------

This can be can done not only in Linux but also in Windows via cmd and via SSH.
Exporting MySQL Database and it's table:
----------------------------------------

Syntax:

mysqldump -p -u [database_username] [database_name] > tables.sql

Example:
---------

mysqldump -p -u rootUser mysitedb > dbmysite.sql

Notes:
---------
  • Do not use flag -p if you don't have a password
  • If you don't have password, please create one.
  • After you run the command, it will ask for password
  • The output tables.sql will be in your working current directory.
  • To know what folder you are after you run the command, in Linux simply type pwd and enter.

Importing MySQL Database and it's table:
----------------------------------------

Syntax:

mysql -p -u [database_username] [database_name] < tables.sql

Example:
---------

mysql -p -u rootUser mysitedb < tbmysite.sql


Common Questions:
---------------------

Q: It doesn't work at all, I got errors
A: Before pasting the error, Please Make sure you have MySQL installed, check the special characters in your .SQL file such as "" vs ‘ ’  vs“ ” and password is correct.


Q: It works but I can't find the file
A: Just locate what folder you are currently in when you perform
command.


Q: Memory limitation; Cannot upload huge file size
A: Check your server or mysql max_file_size_upload just like 
in PHP.ini

Import / Export MySQL via Command Line

Posted on

Wednesday, September 25, 2013

Category

,

,

,

,

Creating folder in Linux via Cli


Creating folder in Linux syntax:

---------------------------------

mkdir [flags as optional] [directory_name]
-----------------------------------------------------------------
Flag  |  Description
-----------------------------------------------------------------
-m    |  Set permission mode using numbers e.g. 755

-p    |  No error if existing, make parent directories as needed.
-v    |  Print a message for each created directory
-Z    | (SELinux) set security context to CONTEXT
-----------------------------------------------------------------
Examples:
------------
  • mkdir Movies #Common straightforward folder creation
  • mkdir -m 644 Movies #Creating folder with permission

# is a comments; do not include it.


Changing filename or folder name in UNIX with Terminal.


Renaming a file/folder syntax:

-----------------

mv [from] [to]


Example for filename:

----------------------

  • mv text1 text2
  • mv "text with space.txt" text_with_no_space.txt

Example for folder name:
-------------------------

  • mv folder1 folder2

For restricted folders, just put sudo before the command e.g. sudo mv /srv/www/index.php /srv/www/index.phtml


In case you need help with command mv, on your command line or terminal, just type either mv --help, mv -help, mv -h, or man mv depending on the distro you are using.


NOTICE:
-------------

For newbie, please refrain using wild characters on your commands because you might mess up everything. To added, do this on regular user and not as a root.