314 reputation
18
bio website
location Switzerland
age
visits member for 4 years, 3 months
seen Mar 23 at 20:51

Jul
6
comment How to see on Linux what network interface and source IP address is used for a route to a specific destination host?
And to get only the interface: ip -o route get $ipaddress | perl -nle 'if(/dev\s+(\S+)/) {print $1}'
Jul
6
comment How do I verify the speed of my NIC?
For Debian based systems, ethtool is not installed by default. But mii-tool is, as part of the essential "net-tools" package. So this was the best solution for me.
Jan
29
comment Detect if remote host is running Windows or Samba
-sV does indeed make it extremely slow as you warned. It does display "Samba..." reliably in my networks, but unfortunately, it doesn't differentiate Macs from Win7 machines.
Dec
30
comment Conditional DNS forwarding with named on Linux
Thanks. I also needed to replace dnssec-validation auto; with dnssec-validation no; in named.conf.options.
Nov
16
comment What is a good solution for an adaptive iptables daemon?
In 12.04LTS, ipset is in the universe repository. sudo apt-get install ipset.
Nov
16
comment Managing iptables rules in Linux
This forum thread has a few examples of scripts using ipsets: forums.gentoo.org/viewtopic-t-863121.html
Nov
16
comment Howto use ipset and iptables on Ubuntu 12.04 to block lots of IPs
Unfortunately, most lists at ipdeny.com seem to be empty. Not sure if it's a temporary problem or if the site is abandoned.
Jul
7
comment Does the OS X DHCP client support classless static routes (RFC3442)?
Using ipconfig with 10.7, the classless routing options are not shown. There seems to be no way to get them in the Mac. Or does the Mac only request certain options and the dhcp server only sends the requested ones?
Jul
7
comment Change gateway on windows 7 from command line
You can replace "add" with "change": route change 0.0.0.0 mask 0.0.0.0 192.168.0.1. That is only active until the next DHCP lease renewal or reboot. For a permanent change you need netsh with the correct interface name.
Jan
9
comment Wake on lan hosts file
No need for a custom file and script. etherwake uses /etc/ethers by default. Populate that file, and you can run etherwake myhostname.
Jan
2
comment How to setup a simple self-hosted dynamic DNS server
If you just need your DHCP server to update your zone, look here. If you also need external machines to update their dynamic IP, this worked for me.
Dec
20
comment PXE boot Windows 7 repair disc from Linux server
I found pxeboot.com inside boot.wim. But my pxe server uses "pxelinux.0" (from Syslinux), so that is what the DHCP server specifies. And I don't know what to write into the "pxelinux.cfg/default" file. I guess tat the usual "kernel" and "append" lines wouldn't make much sense to Windows.
Dec
17
comment What's the best way to check if a volume is mounted in a Bash script?
@rakslice: that wouldn't work. -x makes grep match only if the whole line matches.
Nov
25
comment Resetting NTFS Permissions Disk Wide
In Win7 x64, I got errors when quoting the drive. And for icacls, I could not specify the drive directly. So I had to use takeown /F X:\ /R /D Y and icacls X:\* /reset /T.
Nov
24
comment Resetting NTFS Permissions Disk Wide
You may want to add these options to the icals command: /C (Continue on file errors) and /Q (suppress success messages). Error messages would still be displayed.
Nov
23
comment list all packages from a repository in ubuntu / debian
You may want to rewrite this (before the UUOC Police catches you) to grep Package /var/lib/apt/lists/(repo name)_Packages
Jul
12
comment Use an environment variable in a launchd script
Sure, you can hard code your env. vars in the plist, but you can't use existing vars like $HOME. Unless it's just an argument to a shell script, in which case the shell (not launchd), will expand it. But in this example, it might actually work if you add the -c option to /bin/sh ?
Jun
9
comment How do I list all users with root?
Don't parse /etc/passwd. Users may be defined elsewhere. Use getent passwd instead. For your first "print all users" example, rather try this: getent passwd | perl -naF: -e 'print "$F[0]\n"'
Jun
9
comment How do I list all users with root?
Unlike all other answers which wrongly rely on the /etc/passwd file, this one, using getent passwd instead, is actually correct. Just don't forget to check /etc/sudoers.
Jun
9
comment How do I list all users with root?
All users are definitely NOT guaranteed to be in /etc/passwd. They may be in LDAP, for example. But getent passwd should list all system users (including root), in passwd format, regardless of the database where they are defined.