Browsed by
Category: Linux

WinSCP: Simply copy to remote Linux server

WinSCP: Simply copy to remote Linux server

Overview I wanted a simple method to regularly copy some files from my Windows PC to my file server via SSH. I already used WinSCP to manage files on file server, so just wanted a way to automate a backup similar to rsync. This is a brief tutorial on how to create a simple Winscp script to copy files from a Windows PC to a remote Linux server Solution 1. First download and install WinSCP. 2. Create a new text…

Read More Read More

How to Detect Linux Distribution with Bash

How to Detect Linux Distribution with Bash

This is a simple bash function to get Linux dIstro information such as distribution, architecture and Kernel version. I have managed to use this function in many of my scripts when sending monitoring emails. The Basic Function The function simply queries lsb-release for the distribution information and adds it to  a variable. lsb-release is not in all distributions, however if that is missing it will check other areas that this information might be.

x2goserver-4.0.0.0-4.1 Dependancy Issue

x2goserver-4.0.0.0-4.1 Dependancy Issue

update: This has now been resolved and x2goserver now works with RHEL and is derivatives The latest update to x2goserver (4.0.0.0-4.1) for RHEL and its derivatives currently have an issue where if you try to install x2goserver it requires a dependency that is not part of Red Hat. xorg-x11-fonts-core is a part of OpenSuse and not Red Hat yet the rpm requests it. I have asked the question on server fault but it looks like this is a software bug that…

Read More Read More

Samba error: bind failed on port 137

Samba error: bind failed on port 137

Problem Samba will not start and is showing the following errors in the log files. Feb 6 15:27:02 server nmbd[22392]: [2013/02/06 15:27:02, 0] lib/util_sock.c:open_socket_in(822) Feb 6 15:27:02 server nmbd[22392]: bind failed on port 137 socket_addr = 172.16.203.142. Feb 6 15:27:02 server nmbd[22392]: Error = Cannot assign requested address Feb 6 15:27:02 server nmbd[22392]: [2013/02/06 15:27:02, 0] nmbd/nmbd_subnetdb.c:make_subnet(97) Feb 6 15:27:02 server nmbd[22392]: nmbd_subnetdb:make_subnet() Feb 6 15:27:02 server nmbd[22392]: Failed to open nmb socket on interface 172.16.203.142 Feb 6 15:27:02 server…

Read More Read More

Sendmail: dangerous permissions

Sendmail: dangerous permissions

If you ever get the following errors Feb  6 14:31:22 server sendmail[10862]: dangerous permissions=40777 on queue directory /var/spool/clientmqueue/ Feb 6 14:31:41 server sendmail[10875]: NOQUEUE: SYSERR(root): can not chdir(/var/spool/clientmqueue/): Permission denied This means that the permissions for the folder /var/spool/clientmqueue/ are incorrect simply correct the error by running the following commands chown -R root:smmsp /var/spool/clientmqueue chmod 770 /var/spool/clientmqueue

sysstat: No such file or directory

sysstat: No such file or directory

Problem When you run sysstat you might get the error Cannot open /var/log/sysstat/sa20: No such file or directory This is because sar logging is not enabled on the server yet. Solution Enable logging by running the following command dpkg-reconfigure sysstat Select <Yes> and press return. Manual Method If this does not work change the config file manually edit the file vi /etc/default/sysstat alter the line ENABLED from false to true ENABLED=”false” ENABLED=”true” Restart sysstat /etc/init.d/sysstat restart Wait 10 minutes and…

Read More Read More

Fedora 18: Setting a static IP address

Fedora 18: Setting a static IP address

This is a quick tutorial on how to set a static IP address using the terminal within Fedora 18. note: these instructions also work in Fedora 19. Disable Network Manager 1. First stop and disable the gnome network manager from running on boot. systemctl stop NetworkManager.service systemctl disable NetworkManager.service 2. Now start and enable the network service to run on boot. systemctl restart network.service systemctl enable network.service Set the Static Address 1. Check which interface(s) you want to set as…

Read More Read More

Samba Hide Office Temp Files

Samba Hide Office Temp Files

When working on Office documents like Word, Excel they create a temporary file when they are being worked on. This can sometimes confuse people working on SAMBA shares. See example These temp files will begin with a tilde (~) There is an option in SAMBA to hide certain files with a wildcard. Simply add this line: hide files = /~*/ This means any files with tilde will be hidden until ‘Show hidden files’ are selected in Windows explorer. To ensure they are not seen…

Read More Read More