Assisting 12197966 developers since 2005.

Web Designer, Open Source, Loyal, Dad.  

Read More »

How to Configure VirtualBox with a Static IP in Linux

Posted by David  •  Feb 18th, 2015 7:17:42 pm - Subscribe | Mood: good | Music: Study Music - Music To Make You Smarter

In this entry I will go over how to easily configure VirtualBox and assign your linux machine a static ip.

I am using GNU/Linux CentOs 6.5 as my disto. you may be using something like Ubuntu and if so then that is ok. The main focus here is how to allow VirtualBox to communicate through your network interface card. Once that is completed you can configure your linux machine via it's GUI or the CLI.

Let's get started!
1. Open VirtualBox - I am going to assume that you have your distro already installed on VirtualBox.
2. Click on Network or right click on your distro and go to settings and choose Network.
3. Under Adapter 1 - Checkmark to enable adapter
4. Attached to: Choose Bridge Adapter
5. Name: Choose how you are connected to the internet, you will see a list of adapter names. If you are connected via ethernet (cable) chose that one, or if you are connected to the internet via wifi choose that one. (I am connected via en0: Wi-Fi (Air Port)
6. Now click on the down arrow
7. Adapter type: Choose MT Desktop
8. Promiscuous mode: Choose Allow VM's
9. Click Ok
10. Start your VM

Now you will need to configure your network setting on your Linux VM. I won't go into detail, but my commands are like this.

$ vim /etc/sysconfig/network-scripts/ifconfig-eth0

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.88
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes
DNS1=8.8.8.8
DNS2=8.8.4.4

Be sure to also check your DNS at /etc/resolv.conf

$ vim /etc/resolv.conf

DNS1=8.8.8.8
DNS2=8.8.4.4

That's pretty much it. If you need info on how to assign a static IP in a Debian based system such as Ubuntu follow this documentation and search for Static IP Address Assignment.

Comments 0  •  Feb 18th, 2015 7:17:42 pm - Subscribe  •  Tweet this entry | Post a comment


Advanced Renamer - Batch Rename Utility

Posted by David  •  Feb 1st, 2015 2:45:41 pm - Subscribe | Mood: good | Music: No Music

A small entry and thank you to a freeware project for Windows.

I have been working on a project for a client at work for a couple of months now, and one of the tasks was to rename a large amount (634 pdf files) from one name to another.

I have used many renaming tools before, but none like Advanced Renamer. Advanced Renamer made the task on my Windows Machine so easy, so if you are in need of a truly free renaming tool check out the Advanced Renamer project.

Source
Advanced Renamer - Batch Rename Utility

Comments 0  •  Feb 1st, 2015 2:45:41 pm - Subscribe  •  Tweet this entry | Post a comment


How to Install Linux Screen for Remote Teaching

Posted by David  •  Jan 5th, 2015 12:47:23 am - Subscribe | Mood: tired |

This entry explains how to install the program on linux called screen. Screen can be used to help others via the command line in real time.

So what is screen? Screen will allow you to to view what you are typing in real time. It allows one user to stop the other and ask why they are doing what they are doing in the CLI in real time.



Step by Step Install and Configuration of Screen for CentOS 6.5

1. yum -y install screen
2. Edit /etc/screenrc
3. Add the following snippet of lines to screenrc:

###Multi-user Mode###
multiuser on
acladd username
aclchg username
acldel username
###End Multi-user Mode###

4. Setuid screen binary: chmod u+s /usr/bin/screen
5. Create a user: useradd david
6. Change the password: passwd david
7. Share the username "david" and password with your friend or person assisting you.
8. Via the CLI type: screen
9. Have your friend / assistant type: screen
10. FYI: If you need help type: screen --help
11. Now list the screens: screen -ls
12. Finally have your friend attach to your pid & username. Example: screen -x david/1705.pts-0.dpolanco
13. Complete!

Source:
A Basic Understanding Of screen On Centos

Comments 0  •  Jan 5th, 2015 12:47:23 am - Subscribe  •  Tweet this entry | Post a comment


10 Daily Habits That Will Change Your Life -Challenge Accepted

Posted by David  •  Nov 12th, 2014 5:02:20 pm - Subscribe | Mood: good | Music: di.fm

Here are a list of things that I will be doing for the next 2 weeks. Most of this list I do already, but I am going to follow Ben Rodrigue input and do them all.

1. Wake up an hour earlier than you have to.
2. Quiet your mind for 10 minutes.
3. An attitude of gratitude.
4. Write in a Journal.
5. Write a list
6. Exercise
7. Do Affirmations
8. Do something nice
9. Take on a big task
10. Share these ideas with other people

Read more about each one of these on Ben's Blog below, and leave a comment if you have questions or comments.

Source: 10 Daily Habits that will change your life. -seriously

Comments 0  •  Nov 12th, 2014 5:02:20 pm - Subscribe  •  Tweet this entry | Post a comment


What is lsof Command in Linux?

Posted by David  •  Oct 21st, 2014 10:48:15 pm - Subscribe | Mood: spazzy |

This entry explains the user] of the lsof command which stands for, List of Open Files...this can be really useful if you would like to see what files are currently running for the instance of a particular user.

When running lsof it is always a good idea to specify what you are actually looking for, simply running lsof will give you a slew of data much of it will not be useful to you, especially if you are trying to stop a command that is you to properly administer your linux system.

If you can remember I created an entry called Lost Disk Space on Linux Due to Stop Command. In which I was backing up some critical web dev files, not realizing that I was going to be running out of disk. Take a look at that entry, it gives resolution along with the proper use of the lsof command when things go wrong.

Here are a couple of lsof commands that you can use that will help you make heads or tales of what process is doing what, at what time, and at what location.

  • What process is running on what port: lsof -i tcp:80
    quote:
    Output
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    apache2 2493 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    apache2 2586 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    apache2 2587 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    apache2 13376 root 5u IPv6 2015771 0t0 TCP *:http (LISTEN)


  • List all network connections that are listening and established: lsof -i
    quote:
    Output
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    rpcbind 1495 root 6u IPv4 2196 0t0 UDP *:sunrpc
    rpcbind 1495 root 7u IPv4 2199 0t0 UDP *:820
    rpcbind 1495 root 8u IPv4 2200 0t0 TCP *:sunrpc (LISTEN)
    rpcbind 1495 root 9u IPv6 2203 0t0 UDP *:sunrpc
    rpcbind 1495 root 10u IPv6 2217 0t0 UDP *:820
    rpcbind 1495 root 11u IPv6 2218 0t0 TCP *:sunrpc (LISTEN)
    rpc.statd 1527 statd 4u IPv4 2263 0t0 UDP localhost:855
    rpc.statd 1527 statd 7u IPv4 2272 0t0 UDP *:45172
    rpc.statd 1527 statd 8u IPv4 2276 0t0 TCP *:34261 (LISTEN)
    rpc.statd 1527 statd 9u IPv6 2280 0t0 UDP *:39721
    rpc.statd 1527 statd 10u IPv6 2284 0t0 TCP *:58694 (LISTEN)
    sshd 2322 root 3u IPv4 2461758 0t0 TCP 192.168.1.111:ssh->192.171.117.210:60932 (ESTABLISHED)
    apache2 2493 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    ntpd 2574 ntp 16u IPv4 3329 0t0 UDP *:ntp
    ntpd 2574 ntp 17u IPv6 3330 0t0 UDP *:ntp
    ntpd 2574 ntp 18u IPv4 3337 0t0 UDP localhost:ntp
    ntpd 2574 ntp 19u IPv4 3338 0t0 UDP 192.168.1.111:ntp
    ntpd 2574 ntp 20u IPv6 3339 0t0 UDP ip6-localhost:ntp
    ntpd 2574 ntp 21u IPv6 3340 0t0 UDP [fd08:46b3:7999:0:ba27:ebff:fe98:69d7]:ntp
    ntpd 2574 ntp 22u IPv6 3341 0t0 UDP [2605:6000:170c:400b:ba27:ebff:fe98:69d7]:ntp
    ntpd 2574 ntp 23u IPv6 3342 0t0 UDP [fe80::ba27:ebff:fe98:69d7]:ntp
    apache2 2586 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    apache2 2586 www-data 25u IPv6 2470006 0t0 TCP 192.168.1.111:http->c-98-204-186-50.hsd1.md.comcast.net:62561 (FIN_WAIT2)
    apache2 2587 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    miniserv. 2675 root 6u IPv4 156038 0t0 TCP *:55500 (LISTEN)
    miniserv. 2675 root 7u IPv4 156039 0t0 UDP *:55500
    master 2776 root 12u IPv4 3758 0t0 TCP *:smtp (LISTEN)
    master 2776 root 13u IPv6 3760 0t0 TCP *:smtp (LISTEN)
    apache2 13376 root 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    mysqld 19639 mysql 4u IPv4 501203 0t0 TCP localhost:mysql (LISTEN)
    sshd 21336 root 3u IPv4 502704 0t0 TCP *:ssh (LISTEN)
    sshd 21336 root 4u IPv6 502706 0t0 TCP *:ssh (LISTEN)
    sshd 32495 root 3u IPv4 2288516 0t0 TCP 192.168.1.111:ssh->192.168.1.102:56131 (ESTABLISHED)


  • What user is viewing a specific command or file: lsof -i -u david
    quote:
    Output
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    rpcbind 1495 root 6u IPv4 2196 0t0 UDP *:sunrpc
    rpcbind 1495 root 7u IPv4 2199 0t0 UDP *:820
    rpcbind 1495 root 8u IPv4 2200 0t0 TCP *:sunrpc (LISTEN)
    rpcbind 1495 root 9u IPv6 2203 0t0 UDP *:sunrpc
    rpcbind 1495 root 10u IPv6 2217 0t0 UDP *:820
    rpcbind 1495 root 11u IPv6 2218 0t0 TCP *:sunrpc (LISTEN)
    rpc.statd 1527 statd 4u IPv4 2263 0t0 UDP localhost:855
    rpc.statd 1527 statd 7u IPv4 2272 0t0 UDP *:45172
    rpc.statd 1527 statd 8u IPv4 2276 0t0 TCP *:34261 (LISTEN)
    rpc.statd 1527 statd 9u IPv6 2280 0t0 UDP *:39721
    rpc.statd 1527 statd 10u IPv6 2284 0t0 TCP *:58694 (LISTEN)
    sshd 2322 root 3u IPv4 2461758 0t0 TCP 192.168.1.111:ssh->192.171.117.210:60932 (ESTABLISHED)
    apache2 2493 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    ntpd 2574 ntp 16u IPv4 3329 0t0 UDP *:ntp
    ntpd 2574 ntp 17u IPv6 3330 0t0 UDP *:ntp
    ntpd 2574 ntp 18u IPv4 3337 0t0 UDP localhost:ntp
    ntpd 2574 ntp 19u IPv4 3338 0t0 UDP 192.168.1.111:ntp
    ntpd 2574 ntp 20u IPv6 3339 0t0 UDP ip6-localhost:ntp
    ntpd 2574 ntp 21u IPv6 3340 0t0 UDP [fd08:46b3:7999:0:ba27:ebff:fe98:69d7]:ntp
    ntpd 2574 ntp 22u IPv6 3341 0t0 UDP [2605:6000:170c:400b:ba27:ebff:fe98:69d7]:ntp
    ntpd 2574 ntp 23u IPv6 3342 0t0 UDP [fe80::ba27:ebff:fe98:69d7]:ntp
    apache2 2586 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    apache2 2587 www-data 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    miniserv. 2675 root 6u IPv4 156038 0t0 TCP *:55500 (LISTEN)
    miniserv. 2675 root 7u IPv4 156039 0t0 UDP *:55500
    master 2776 root 12u IPv4 3758 0t0 TCP *:smtp (LISTEN)
    master 2776 root 13u IPv6 3760 0t0 TCP *:smtp (LISTEN)
    apache2 13376 root 5u IPv6 2015771 0t0 TCP *:http (LISTEN)
    mysqld 19639 mysql 4u IPv4 501203 0t0 TCP localhost:mysql (LISTEN)
    sshd 21336 root 3u IPv4 502704 0t0 TCP *:ssh (LISTEN)
    sshd 21336 root 4u IPv6 502706 0t0 TCP *:ssh (LISTEN)
    sshd 32495 root 3u IPv4 2288516 0t0 TCP 192.168.1.111:ssh->192.168.1.102:56131 (ESTABLISHED)


    Well I hope this brief snippet of information shows you how useful the lsof command can be, if you have any commands that you would like to share, leave a comment below.

    Comments 0  •  Oct 21st, 2014 10:48:15 pm - Subscribe  •  Tweet this entry | Post a comment



  • Image Gallery

    Badges


    Amazon Wishlist Stumble Upon Toolbar
    Internet Blogs - Blog Top Sites Internet Blogs - Blog Top Sites Technology

    About Me

    avatar

    @davidpolanco
    iPhone: 29.513522,-98.565523 Web Designer, Open Source, Loyal, Dad. Learn more...