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 => res_http_websocket.so	; for chan_sip.so load
preload => res_speech.so		; for res_agi.so load
preload => res_agi.so			; for app_stack.so load
preload => res_monitor.so		; for app_queue.so correct load
preload => res_ael_share.so		; for pbx_ael.so 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 127.0.0.1:3306, and you have only SSH access to the remote server.

lexus@lexus:~$ ssh user@remote-server -L 3306:127.0.0.1:3306 -N
support@remote-server’s password: (press Ctrl-Z)
^Z
[1]+ Stopped ssh user@remote-server -L 3306:127.0.0.1:3306 -N
lexus@lexus:~$ bg
[1]+ ssh user@remote-server -L 3306:127.0.0.1:3306 -N &
lexus@lexus:~$ mysql -h 127.0.0.1 -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 http://old-releases.ubuntu.com/ubuntu/ CODENAME main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-security main restricted universe multiverse

# Optional
#deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-backports main restricted universe multiverse

That’s enough.
Read more if you’re interested in.
https://help.ubuntu.com/community/EOLUpgrades
http://old-releases.ubuntu.com/releases/