Archive for July, 2016

Asterisk 11: some required modules

Monday, July 18th, 2016

Asterisk 11, modules, which have to be loaded for other basic modules to work properly.

preload =>	; for load
preload =>		; for load
preload =>			; for load
preload =>		; for correct load
preload =>		; for correct load // also works without this,
                                        ; but WARNING while loading

Linux: limit CPU usage by running process

Monday, July 18th, 2016

Use cpulimit for this.

We have a 8-core CPU (it means the total CPU usage can be 800%, and 100% for 1 core respectively).
Our process is ‘raid-check’.

/usr/bin/cpulimit --exe /usr/sbin/raid-check --limit 600

I added this line to crontab config. The reason is that my Asterisk stops accepting calls when the CPU load is too high. Of course you can also use asterisk.conf settings to achieve the desired results.

[root@voip-ge ~]# cat /etc/cron.d/raid-check
# Run system wide raid-check once a week on Sunday at 1am by default
0 1 * * Mon root /usr/sbin/raid-check

# limit the CPU usage by executable name
1 1 * * Mon root /usr/bin/cpulimit --exe /usr/sbin/raid-check --limit 600

SSH port forwarding

Saturday, July 16th, 2016

Assuming, MySQL is running on ‘remoteserver’ on, and you have only SSH access to the remote server.

lexus@lexus:~$ ssh user@remote-server -L 3306: -N
support@remote-server’s password: (press Ctrl-Z)
[1]+ Stopped ssh user@remote-server -L 3306: -N
lexus@lexus:~$ bg
[1]+ ssh user@remote-server -L 3306: -N &
lexus@lexus:~$ mysql -h -p -u sqluser
Enter password:

Ubuntu: old releases repositories

Friday, July 8th, 2016

If your Ubuntu is too old and aptitude stopped working, showing 404 not found.

Add this to /etc/apt/sources.list, changing the CODENAME to your Ubuntu version.

## EOL upgrade sources.list
# Required
deb CODENAME main restricted universe multiverse
deb CODENAME-updates main restricted universe multiverse
deb CODENAME-security main restricted universe multiverse

# Optional
#deb CODENAME-backports main restricted universe multiverse

That’s enough.
Read more if you’re interested in.