Backtrack:

showing posts tagged with 'linux'
by lunarg on April 15th 2013, at 08:40

You can script password changes in linux by using passwd without any additional effort. The syntax for this is:

echo "your-password" | passwd --stdin user
by lunarg on March 28th 2013, at 14:15

You can change the delimiter of a for-loop by changing the value of the global variable $IFS. By default this is set to a space. For example, if you want the delimiter to be a new line, set it like so: IFS=$'n'
by lunarg on March 13th 2013, at 11:13

Simple Linux Load is a simple disk and CPU load generator to stress linux servers. I mashed this up when I had to put some load on a machine to troubleshoot issues with it which were only occuring under load.

It consists of two very simple shell scripts, each generating and deleting a 4GB file, and this in a loop.

• rnd.sh: the file is filled with random numbers, and stresses the CPU more than the disk;
• zero.sh: the file is filled with zeroes, and stresses the disk more than the CPU.

There's no licensing on these scripts. You can do with it whatever you want.

by lunarg on January 10th 2013, at 17:53

You can disable SSL in fetchmail by adding this line to your rc file:

sslproto ssl23

This restricts fetchmail to only use SSLv2 and SSLv3, disabling TLSv1. Note that this will cause the connection to be unencrypted, unless you use a proper SSL plugin, or SSL is requested explicitly.

by lunarg on November 26th 2012, at 17:42

Google Chrome can start up in fullscreen (F11) by default. This is done by enabling Kiosk-mode during startup. To do this, set the shortcut to Chrome like so:

C:\path\to\chrome.exe --kiosk

by lunarg on September 24th 2012, at 12:24
When running dnsmasq inside a VPS on an OpenVZ server, you may get an error while trying to start up dnsmasq (this is in particular the case for Debian):Starting DNS forwarder and DHCP server: dnsmasqdnsmasq: setting capabilities failed: Operation not permitted

This is because dnsmasq does not run as root (which is a good thing). What happens is that dnsmasq gets started as root, then attempts to set privileged functions to the dnsmasq user before changing user from root to that user. When setting these capabilities fails, you get the above error.

The reason for failing is usually because either the kernel is missing the required features, or, in case of OpenVZ, the permissions are not pas  ...
by lunarg on November 4th 2011, at 14:51
You can remote-reboot your Polycom phones from the Asterisk CLI by sending a SIP NOTIFY command. This command instructs the phone to recheck its configuration, and therefore, will reboot when certain parameters have been set in your phone configuration provisioning.

Make sure the following directive is set in your provisioning config:

<specialEvent voIpProt.SIP.specialEvent.checkSync.alwaysReboot="1" />

You find this in sip.cfg, or you can set it in your own configuration (mine's called aaps-settings.cfg, but that's just an arbitrary name).

Notice
When setting this variable in your own configuration, be sure that it's set in the right context, like so:<localcfg> &l  ...

by lunarg on September 28th 2011, at 12:23
If you wish to restrict SMTP access via IP addresses or a network range, one way to do it would be via Postfix configuration. You can set up restrictions using a Postfix hash-table or via a cidr file. You can choose one or both methods to perform the restrictions. The end-result will be the same.

Create a text file with the addresses you would like to reject. You can choose whatever file name you wish. E.g.: /etc/postfix/smtp_client_access

Its content should be something like:

192.168.0.1 REJECT Stop mailing us192.168.0.2 REJECT Stop mailing us192.168.1 REJECT Stop mailing us

Next, postmap it by running:

postmap /etc/postfix/smtp_client_access

smtpd  ...

by lunarg on June 5th 2011, at 13:17

To have scripted automated backup of PostgreSQL databases on a linux platform, you can create a script like so:

#!/bin/bash
PGPASSWORD="your-password" /usr/bin/pg_dump -U user database > sql-file.sql

Replace user and your-password with your username and password; replace database with the database you want to backup. The output of the dump goes to stdout and can be piped to a plain text file or compressed to something else.

by lunarg on October 20th 2010, at 11:57
Debian has introduced incremental updating of package lists. While in theory, this is a great feature, it is not always practical.

Incremental updates enable to download less data by fetching only the differences between the previous versions of the list. This results in significant savings concerning the amount of downloaded data.
The unfortunate downside is that a whole lot more fetches need to be done as each incremental update requires a server request. This becomes apparent when you don't often download package list updates, and there are suddenly a whole number of files waiting to be downloaded. The overhead of requesting each incremental slice separately causes the update to take mor  ...
by lunarg on August 26th 2010, at 12:53
While batch processing was already possible using the rather complex Script-Fu, there's now a plug-in for GIMP allowing simple batch processing through a dialog.

DBP David's Batch Processor allows for automatic operations on a collection of image files. Operations such as colour correcting, resizing, cropping, sharpening, and even renaming can be performed with ease, saving them to a different location in a different image format. All operations (except loading and saving) are optional so you can use this for simple image format conversion as well.

DBP can be found here: http://members.ozemail.com.au/~hodsond/dbp.html.
It is mainly designed for linux version of The GIMP but pre  ...
by lunarg on August 24th 2010, at 16:31

This package provides files to enable syntax highlighting in nano when editing shorewall configuration files, making it easier to maintain these kinds of files.

by lunarg on August 23rd 2010, at 16:47

For a shell script to determine its own location, you can use this code snippet. It takes relative and absolute paths into account.

#!/bin/bash
if [[ $0 == '/'* ]]; then MYLOCATION="dirname$0"
else
MYLOCATION="pwd"/"dirname $0" fi echo "My location is:$MYLOCATION"
by lunarg on August 19th 2010, at 16:19

If for some reason you lost your SSH server keys, sshd will fail to start with error:

Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key

You can recreate your host keys with these commands:

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key

After recreating the keys, you will probably have to let your clients know as with the change of keys, they'll probably get warnings about it (Linux SSH will not even connect until you kick out the old keys).

by lunarg on June 23rd 2010, at 17:14
Working on implementing Multi-WAN at our office (more about that later), in which we use a rather special routing setup, we got this error message on our IPSEC tunnels:

Quote
ipsec_setup: Starting Openswan IPsec U2.4.12/K2.6.26-2-amd64...
ipsec_setup: no default route, %defaultroute cannot cope!!!

While the reason was obvious to me (there's indeed no default route in the main routing table, this is by design), fixing the problem was not.
I tried adding options like leftnexthop=ip-address but it did not really matter; the error persisted.

After searching around Google, I came across a post with a similar error, along with an unusual solution: adding the following line solve  ...
by lunarg on June 3rd 2010, at 20:03
Linux has always been a great player in internetworking, thanks to a very advanced networking stack. In addition, the filtering capabilities provided by Netfilter are only surpassed by a very select group of devices. It doesn't come as a surprise there are a lot of firewalls and internet gateways out there that are running this powerful combo.
Detailing the features of linux as a firewall/internet gateway would take up an entire article so I'm not going to elaborate on it. It suffices to say that whatever you can think up of setting up, the linux + netfilter combo can probably do it. Worst case, there are other third party applications (Squid as a web proxy and content filter, for instance)   ...
by lunarg on April 14th 2010, at 20:22

Like any other MTA, Postfix has a maximum message size that it allows to pass through. By default, when not defined, it is set to 10 MB.
To change it, add/change the following in main.cf:

message_size_limit = 15728640

This sets the limit to 15 MB. To make it unlimited, set it to 0.

by lunarg on April 1st 2010, at 15:14
Had an issue where I was not able to change the post_max_size and upload_max_filesize through the Apache2 configuration.
After googling around, I finally found what was wrong: apparently, aside of php_flag, there's also a php_value flag to set configuration variables. The difference?

Use php_flag only when setting boolean values like 0 | 1, off | on.

Use php_value to actually set values other than boolean (like the filesizes of post_max_size and upload_max_filesize).

Thus, a working example looks like:

<Directory /var/www/> <IfModule mod_php5.c> php_flag register_globals off php_value post_max_size 16M php_value upload_max_filesize 16M </IfModule><  ...
by lunarg on February 1st 2010, at 16:46
To set up a Windows PPTP VPN server behind your OpenWRT enabled router, you need to forward the necessary ports and protocols, and install the proper modules.

Finding information about how to do this was a lengthy process. I never actually found the necessary info (although I noticed there are quite a few people which are rather clueless about networking; makes me wonder why they're bothering with OpenWRT in the first place, it's not the easiest firmware out there).
But I've managed to compile the bits and pieces of various sources into a coherent mass. It's not a guide in the literal sense, but will tell you want you need, assuming you do know your way around OpenWRT.

The setup was tested  ...
by lunarg on January 6th 2010, at 10:18
Versions 3.2 of SpamAssassin have (until very recently) a bug in their rules which would mark mails dated 2010 (this year) as being spam.

The reason for this is that a rule exists which would add an additional score of 3.2 to mails with a date set to 2010, because when the rule was created, the date would be in the very far future. Of course, this is no longer the case.

The bug was already discovered in 2008, and resolved in the SpamAssassin repositories, but was not backported to 3.2 until 2010-01-01, when the issue was discovered by Mike Cardwell, a developer in the UK.

Users with this problem can easily resolve it by updating the rules:

sa-update

This changes the regexp so it exclude  ...
showing posts tagged with 'linux'
 « ‹ March 2021 › » Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31