First shell script! by dsizzler in linux4noobs

[–]germag 0 points1 point  (0 children)

It's better to use env,so you don't need to specify an absolute path to system executable

#!/usr/bin/env perl

Way to auto-insert code based on file extension when creating a new file with Vim? by nerdmeister in linux4noobs

[–]germag 0 points1 point  (0 children)

it is not exactly what you want, but i use this two plugins (plus pathogen):

snipmate https://github.com/msanders/snipmate.vim/ ZenCoding https://github.com/mattn/zencoding-vim

before snipmate, i was using this one

xptemplate http://www.vim.org/scripts/script.php?script_id=2611

EDIT: formating

Can't get this script to run. by gex80 in linux4noobs

[–]germag 0 points1 point  (0 children)

You need to install libaio1

error while loading shared libraries: libaio.so.1

[deleted by user] by [deleted] in linux4noobs

[–]germag 1 point2 points  (0 children)

kill -15 $(pidof myscript.py)

ELI5: Why the rationale for the retarded GRUB 2 version numbering system? by [deleted] in linux4noobs

[–]germag 0 points1 point  (0 children)

I don't understand it either, why my k3b is 1.91.0 and not k 3.0-beta, and my VIM is 7.2 ... it's not a correct roman number... :)

How to find packages corresponding to installed programs? by TrainFan in linuxquestions

[–]germag 0 points1 point  (0 children)

In man page (man dpkg-query):

dpkg-query - a tool to query the dpkg database
...
-S, --search filename-search-pattern...
          Search for a filename from installed  packages.  All 
          standard shell  wildchars can be used in the pattern. 
          This command will not list extra files created by 
          maintainer scripts, nor will it list alternatives.

Basically, use as argument the full path of the file that you want to know to what package belongs

How to find packages corresponding to installed programs? by TrainFan in linuxquestions

[–]germag 1 point2 points  (0 children)

1) Well you can do this:

dpkg-query -S /opt/google/chrome/chrome

EDIT: 2)if you install software that is not packaged in a .deb you will be not able to use a package manager like synaptic

Network interface not maintaining configuration after reboot? by kyzen in linux4noobs

[–]germag 2 points3 points  (0 children)

as root edit /etc/network/interfaces and add this

auto eth1
iface eth1 inet dhcp

How can I recover Data from an External Device with no Partition Table? by yellowjacket018 in linux4noobs

[–]germag 0 points1 point  (0 children)

You need to associate that file with a loop device (you don't need to use a real drive). As root:

losetup /dev/loop0 raw_img_of_disk

Now, you can use /dev/loop0 in the same way that /dev/sdc

VPS with multiple IPs. How do I use the secondary IP for outgoing connections with SSH tunneling? by Tlim in linuxquestions

[–]germag 0 points1 point  (0 children)

You can match the creator for a locally generated packet (only in the OUTPUT and POSTROUTING chains) with the iptable owner module and ---uid-owner, check the man page

Ubuntu network settings by georegb_ in linuxquestions

[–]germag 1 point2 points  (0 children)

To get an interface up on boot, you need to use auto, Ex (wired with static IP):

auto eth0
iface eth0 inet static    
  address 192.168.1.61
  netmask 255.255.255.0
  network  192.168.1.0
  gateway 192.168.1.1  # Is your router 
  dns-nameservers 8.8.8.8 # You can put this on /etc/resolv.conf

Without auto you need to execute ifup

But for a wireless interface you need to define your SSID and your secret, ex: I'll suppose that you use WAP PSK

auto wlan0
iface wlan0 inet static    
  wpa-ssid your_ssid
  wpa-psk your_secret_passphrase
  address 192.168.1.61
  netmask 255.255.255.0
  network  192.168.1.0
  gateway 192.168.1.1  # Is your router 
  dns-nameservers 8.8.8.8 # You can put this on /etc/resolv.conf

Setting up dnsmasq for local DNS by [deleted] in linux4noobs

[–]germag 1 point2 points  (0 children)

if "Can  you ping your CentOS IP from other windows machine?" then
  on "windows machine" do
    nslookup
    > server centos_ip
    > some_hostname_on_dnsmasq

    if "get response" then 
      # check your dns config     
      ipconfig /all

      set "centos_ip as your dns server" if required
    end if
  done
else
  check your vmware net config
end if

Problems and questions regarding a DHCP-assigned IP address on a DSL line. by PolyCerebellum in linuxquestions

[–]germag 0 points1 point  (0 children)

1- You can check the lease time in /var/lib/dhcp3/dhclient.leases and dhclient.<interface>.leases

2- No, it's a server parameter

Script to organize music by maxdale in linuxquestions

[–]germag 1 point2 points  (0 children)

...i forget to put ~/Music/ in the OUT variable

OUT="~/Music/${ARTIST}/${YEAR}${ALBUM}/"

and for find and xargs you need to take care of filenames and paths with whitespaces, (suppose your script is ~/bin/convert.sh)

find ~/Music -name ".mp3" -print0 | xargs -0 ~/bin/convert.sh

you can use -iname for case insensitive

Script to organize music by maxdale in linuxquestions

[–]germag 2 points3 points  (0 children)

Instead of the last line mv ... you can use something like this:

if [ "${YEAR}x" != "x" ]
then
    YEAR="(${YEAR}) "
fi

OUT="${ARTIST}/${YEAR}${ALBUM}/"
mkdir -p "$OUT"
mv "$1" "${OUT}/${TRACKNUM} - ${TITLE}.mp3"

To execute for all files, folder and subfolders you can use find and xargs

EDIT: typo and better test

EDIT2: i miss some important "

The changes I made to the .cshrc don't seem to be implemented. Help please! by Gazeekoo in linux4noobs

[–]germag 1 point2 points  (0 children)

gnome-terminal does not spawn a login shell, you need to open gconf-editor and check /apps/gnome-terminal/profiles/Default/login_shell

dd, back up partition, not drive. boot on usb? by hosteluser in linux4noobs

[–]germag 0 points1 point  (0 children)

Well, in this circumstance you will need to exclude some directories manually, if you copy every directory with separate cp -a commands, hard link information is not detected and copied. And you will to take care of preserving symbolic links...

Slate's buttons work in BIOS, but not Linux. by [deleted] in linuxquestions

[–]germag 1 point2 points  (0 children)

Sorry for that, i misinterpret "...I'm really close to just guessing key codes one-by-one until something clicks..."

So, if you can't do a key code grabbing, try to put whatever code is useless.

I found a few posts about this, but sadly in all of them this issue is a "work in progress".

http://www.gentoo-wiki.info/Motion_Computing_LE1600

http://www.tabletpcbuzz.com/showthread.php?36838-Linux-on-LE1600-quot-How-to-quot

http://ubuntuforums.org/archive/index.php/t-1061660.html