programming

Java: Add autocompletion to a (editable) JComboBox

1. Download this source code and add to your Java project:
http://www.orbital-computer.de/JComboBox/source/AutoCompletion.java

2. Add folowing code to enable autocompletion for your JComboBox:
AutoCompletion.enable(yourComboBox);

For further information about JComboBox and AutoCompletion see:
http://www.orbital-computer.de/JComboBox/
https://today.java.net/pub/a/today/2007/07/19/adding-auto-completion-to-swing-comboboxes.html

Asterisk

asterisk console
asterisk -r

set output to verbose
core set verbose 10

CLI commands
core show channels
capi show channels
capi info
reload
sip show peers

asterisk -rx "sip show registry"

end / destroy channel
core show channels
soft hangup SIP/XXXXXX

MOH
wget http://downloads.digium.com/pub/telephony/sounds/asterisk-moh-freeplay-wav.tar.gz -P /tmp
tar xzf /tmp/asterisk-moh-freeplay-wav.tar.gz -C /tmp
cp /tmp/fpm-sunshine.wav /var/lib/asterisk/moh/
# extensions.conf

Zenity

delete files with auto close message
rm /media/CAMCARD/DCIM/100NIKON/*.JPG; sync; sleep 1 | zenity --title CleanCAMCARD --progress --auto-close

view message
zenity --info --text "blah"

Cisco 7960 upgrade firmware

Upgrade firmware

#download firmware
wget http://www.cisco.com/pcgi-bin/tablebuild.pl/sip-ip-phone7960
 
# unzip files
unzip P0S3-08-2-00.zip
 
# set rights
chmod a+r P0* OS79XX.TXT
 
# move files to /tftpboot
mv ./P0S3-08-2-00/* /tftpboot/
 
# add link
??? ln -s /tftpboot/P003-08-2-00.bin /tftpboot/P0S3-08-2-00.bin
 
# edit Global config
vi /tftpboot/SIPDefault.cnf
image_version: P0S3-08-2-00

[LINKS]
http://www.ip-phone-forum.de/

python

string
http://thepythonguru.com/python-strings/
https://www.tutorialspoint.com/python/string_startswith.htm
if var1 != var2:

output to file
text_file = open("/tmp/debug", "w")
text_file.write("option1: %s\n" % option1)
text_file.write("value1: %s\n" % value1)
text_file.close()

List available pyenv versions
https://www.python.org/ftp/python/
pyenv install --list

# virtualenv ?
pip install -U virtualenv --user
mkdir -vp ~/test
cd ~/test
virtualenv .venv
source .venv/bin/activate
pip install -U pip