Showing posts with label Kubuntu. Show all posts
Showing posts with label Kubuntu. Show all posts
Wednesday, 25 May 2016
Saturday, 13 June 2015
Kubuntu DNS settings
Seem like DNS settings are no longer stored in resolv.conf but this can still be extracted from the netwok Manager CLI.
This will return information including:
Therefore a quick awk can return the value needed:

nmcli dev show [device] e.g. nmcli dev show wlan0
This will return information including:
IP4.DNS[1]:
IP4.DOMAIN[1]:
IP4.DOMAIN[1]:
Therefore a quick awk can return the value needed:
nmcli dev show wlan0 | grep IP4.DNS | awk -F: '{ print $2 }' | awk '{ print $1 }'
Tuesday, 5 October 2010
To test if a port is open on linux
Well I wanted to test if a linux box is ready to receive syslog log files remotely and used netcat / ccat / nc for the purpose.
It is a server/client application whereby you run the server in listen mode and then start the client on a different host and connect to the server, it can create both tcp and udp connections.
I had some trouble with the syntax on Ubuntu 10.04 Lucid Lynx and hence will post the commands that worked for me:
Server:
-l : is for listen
-u : is for udp
Client:
where 192.168.0.1 is the ip of the server
If it connects you can then type anything in the client and it will display in the server window confirming the port is available and no firewall is blocking teh traffic, hence you can move to the application layer.
It is a server/client application whereby you run the server in listen mode and then start the client on a different host and connect to the server, it can create both tcp and udp connections.
I had some trouble with the syntax on Ubuntu 10.04 Lucid Lynx and hence will post the commands that worked for me:
Server:
user@server:~$ sudo nc -l -u 514
-l : is for listen
-u : is for udp
Client:
user@client:~$ nc 192.168.0.1 -u 514
where 192.168.0.1 is the ip of the server
If it connects you can then type anything in the client and it will display in the server window confirming the port is available and no firewall is blocking teh traffic, hence you can move to the application layer.
Wednesday, 9 December 2009
Can't ping FQDN in Ubuntu
I created a local DNS zone ending in .local and experienced weird DNS behaviour; dig worked 100%
It seems the avahi-daemon interferes with the normal resolving process. It’s DNS caching borks the normal functionality
The fix:
It seems the avahi-daemon interferes with the normal resolving process. It’s DNS caching borks the normal functionality
The fix:
# shut it down
sudo /etc/init.d/avahi-daemon stop
# stop it starting at the next reboot by removing the startup links
sudo update-rc.d -f avahi-daemon remove
Removing any system startup links for /etc/init.d/avahi-daemon ...
/etc/rc1.d/K86avahi-daemon
/etc/rc2.d/S50avahi-daemon
/etc/rc3.d/S50avahi-daemon
/etc/rc4.d/S50avahi-daemon
/etc/rc5.d/S50avahi-daemon
Monday, 22 June 2009
Symbolic Links in ProFTPd
A symbolic link (also referred to as a "symlink") is a file whose contents contain the name of the file to which the symbolic link points. For example:
The file
will be unaffected; only paths that point outside/above the new root will be affected.
so clearly this will not work in a ProFTPd default directory
The trick is to use re-mount the directory you want listed again
To have an exact duplicate of the
On Kubuntu 9.x with kernel 2.6.28-11-generic the command was:
This mounted the Sorted MP3 directory under the FTPServer DefaultRoot directory.
In order to have these tricks persist, to survive a system reboot, the
fstab
to mount a folder locally to another folder using --bind, ie. mount --bind /path1/ /path2/
To mount a folder with spaces in fstab use "\040"
/media/disk/Sorted\040MP3/ /home/sharedftp/download/Music/ bind defaults,bind 0 0
lrwxrwxrwx 1 root root 11 Mar 2 2000 rmt -> /sbin/rmt
The file
rmt contains the nine characters /sbin/rmt. The reason symbolic links fail when chroot(2) is used to change the position of the root (/)of the filesystem is that, once / is moved, the pointed-to file path changes. If, for example, if chroot(2) is used to change the filesystem root to /ftp, then the symlink above would be actually be pointing to /ftp/sbin/rmt. Chances that that link, if chroot(2) is used, now points to a path that does not exist. Symbolic links that point to nonexistent files are known as dangling symbolic links. Note that symbolic links to files underneath the new root, such as symlinks to a file in the same directory:> pwd
/var/ftp
> ls -l
-rw-r--r-- 1 root root 0 Jan 16 11:50 tmpfile
lrwxrwxrwx 1 root root 7 Jan 16 11:50 tmplink -> tmpfile
will be unaffected; only paths that point outside/above the new root will be affected.
so clearly this will not work in a ProFTPd default directory
The trick is to use re-mount the directory you want listed again
To have an exact duplicate of the
/var/ftp/incoming directory available in /home/bob/incoming and /home/dave/incoming, use one of these commands:- Linux (as of the 2.4.0 kernel):
mount --bind /var/ftp/incoming /home/bob/incoming
mount --bind /var/ftp/incoming /home/dave/incoming
or, alternatively:mount -o bind /var/ftp/incoming /home/bob/incoming
mount -o bind /var/ftp/incoming /home/dave/incoming
On Kubuntu 9.x with kernel 2.6.28-11-generic the command was:
sudo mount --bind /media/disk/Sorted\ MP3/ /home/sharedftp/download/Music/
This mounted the Sorted MP3 directory under the FTPServer DefaultRoot directory.
In order to have these tricks persist, to survive a system reboot, the
/etc/fstab file may need to have these mounts addedfstab
to mount a folder locally to another folder using --bind, ie. mount --bind /path1/ /path2/
/path1 /path2 bind defaults,bind 0 0
To mount a folder with spaces in fstab use "\040"
/media/disk/Sorted\040MP3/ /home/sharedftp/download/Music/ bind defaults,bind 0 0
Subscribe to:
Comments (Atom)
