петък, 18 март 2011 г.

How to connect to internet trough terminal?

First, check out this cool site for Linux command. You probably already know most of them, but still, it's a useful reminder.

Code Listing 3.11: Using ifconfig
# ifconfig eth0 ${IP_ADDR} broadcast ${BROADCAST} netmask ${NETMASK} up
Now set up routing using route. Substitute ${GATEWAY} with your gateway IP address:

Code Listing 3.12: Using route
# route add default gw ${GATEWAY}
Now open /etc/resolv.conf with your favorite editor (in our example, we use nano):

Code Listing 3.13: Creating /etc/resolv.conf
# nano -w /etc/resolv.conf
Now fill in your nameserver(s) using the following as a template. Make sure you substitute ${NAMESERVER1} and ${NAMESERVER2} with the appropriate nameserver addresses:

Code Listing 3.14: /etc/resolv.conf template
nameserver ${NAMESERVER1}
nameserver ${NAMESERVER2}
source - Gentoo wiki
Also if you want to connect trough wifi, use this wiki:

  1. Connecting to an OPEN / WEP WLAN (DHCP)
    1. iwconfig yourinterface mode managed key yourwepkey(128 bit WEP use 26 hex characters, 64 bit WEP uses 10)
    2. iwconfig yourinterface essid youressid (Specify ESSID for the WLAN)
    3. dhclient yourinterface(to receive an IP address, netmask, DNS server and default gateway from the Access Point)
  2. Connecting to an OPEN / WEP WLAN (Manual IP Setup)
    1. iwconfig yourinterface mode managed key yourwepkey (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)
    2. iwconfig yourinterface essid youressid (Specify ESSID for the WLAN)
    3. ifconfig yourinterface youripaddress netmask yoursubnetmask
    4. route add default gw yourgateway (Configure your default gateway; usually the IP of the Access Point)
    5. echo nameserver yourdnsserver >> /etc/resolve.conf (Configure your DNS server)
There are also some very useful commands on this site.  The most important:
ifconfig [interface] up (bring up specified interface)

ifconfig [interface] down (take down specified interface)

ifconfig [interface] hw ether [MAC] (Change the wireless cards MAC address, specify in format 11:11:11:11:11:11)

And finally, you can try this, if you want to automate the process.

вторник, 1 март 2011 г.

How to make Amarok see changes in tags?

I installed easytag to edit somewhat the tags of my songs, since Amarok has some problem going from cp1251 to unicode . So I edited my tags, but Amarok didn't update them. I searched a little and found this extremely useful command:
find /media/music -exec touch {} \; 
What it does is to change the date to all files in the directory and thus when Amarok rescan the collection (I forced it with update collection), it sees the new tags and everything is nice again. Source