programming

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

Asterisk auto-dial out with Java (asterisk-java)

# configure manager
/etc/asterisk/manager.conf
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0 
 
[manager]
secret=pa55w0rd
permit=0.0.0.0/0.0.0.0
read=system,call,log,verbose,agent,command,user
write=system,call,log,verbose,agent,command,user
 
# create extension
/etc/asterisk/extensions.conf
[directdial]
exten => 1,1,Dial(CAPI/ISDN1/${customernum}/b)
 
# reload asterisk
/etc/init.d/asterisk restart
 
# download java class
wget http://maven.reucon.com/public-snapshot/org/asteriskjava/asterisk-java/1.0.0-SNAPSHOT/asterisk-java-1.0.0-20090303.204542-422.jar
 
# HelloMa

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

Titanic

Sourcecode
http:/dl.panticz.de/schiff/schiff.src.tar.bz2
http:/dl.panticz.de/schiff/schiff_NetBeans_Project.zip

Executable
http:/dl.panticz.de/schiff/schiff.tar.bz2
http:/dl.panticz.de/schiff/schiff.zip

Documentation
http:/dl.panticz.de/schiff/schiff_1.pdf
http:/dl.panticz.de/schiff/schiff_2.pdf

Links
http://www.arndt-bruenner.de/mathe/scripts/gleichungssysteme.htm

extractEbook.sh

#!/bin/bash
 
# install
# apt-get install pdftk
 
FILE=$1
PAGES=$2
OUT=$3
 
COVER=/media/lagerliste/vorlagen/ebook/cover.pdf
 
# check if file already exists
if [ -f ${OUT} ]; then
	echo "${OUT} already exists"
	exit 0
fi
 
# get pages
pdftk A=${COVER} B="${FILE}" cat A1 B${PAGES} output /tmp/pdftk.out.pdf
 
# reduce image resolution
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -sOutputFile="${OUT}" -f /tmp/pdftk.out.pdf
 
# view
if [ -n ${DISPLAY} ]; then
	evince "${OUT}"
fi
 
 
# USAGE
# ./mkEbook.sh s02_s201.pdf 1-3  ../ebook/l83_1.1_antike.pdf

Cascading Style Sheets

# transparent image on mouse over (IE too!)
<style type="text/css">
<!--
.content a:hover img {
	filter:alpha(opacity=75); 
	opacity: 0.75;
}
-->
</style>
 
# LINKS
http://www.mandarindesign.com/opacity.html
 
 
 
#content p {
font-family:Palatino,Georgia,'Times New Roman',serif;
font-size:16px;
line-height:1.5em;
margin:0;
padding:0 0 10px;
}

Compile error on Intrepid

/home/pako/xserver-xorg-video-ati-6.6.3# fakeroot ./debian/rules binary
 
mkdir stampdir
>stampdir/stampdir
if [ ! -e stampdir/patches ]; then \
		mkdir stampdir/patches; \
		ln -s stampdir/patches .pc; \
		echo 2 >stampdir/patches/.version; \
	fi; \
	if [ ! -e stampdir/log ]; then \
		mkdir stampdir/log; \
	fi; \
	if [ ! -e patches ]; then \
		ln -s debian/patches patches; \
	fi; \
	>stampdir/prepare
if ! [ `which quilt` ]; then \
		echo "Couldn't find quilt.

Install Drupal SMTP authentication support module

# install SMTP Authentication Support
http://drupal.org/project/smtp
 
download
http://ftp.drupal.org/files/projects/smtp-6.x-1.0-beta4.tar.gz
extract
copy smtp /var/www/sites/all/modules
 
# install PHPMailer
#http://phpmailer.worxware.com/
#http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php5_6/
 
download phpMailer v2.3 (NOT 5.x)
http://downloads.sourceforge.net/phpmailer/phpMailer_v2.3.tar.gz
extract
rename phpMailer_v2.3 to phpmailer (LOWERCASE!)
copy phpMailer/ /sites/all/modules/smtp/
 
 
# Configure
# Enable the SMTP Authentication Support module 
Admi

convertToUtf.php

<?php
function convertToUtf($string) {
	$string = str_replace("ü", "ü", $string);
	$string = str_replace("Ãœ", "Ü", $string);
	$string = str_replace("ö", "ö", $string);
	$string = str_replace("Ö", "Ö", $string);
	$string = str_replace("ä", "ä", $string);
	$string = str_replace("Ä", "Ä", $string);
	$string = str_replace("ß", "ß", $string);
 
	return $string;
}
?>

Create GWT MySQLConn project under Netbeans

# HowTo
1. install Netbeans: http://www.panticz.de/install_netbeans
1.1 install http://www.panticz.de/install-GWT4NB
2. install GWT: http://www.panticz.de/install_gwt
3. install MySQL driver: http://www.panticz.de/install_mysql_driver
4.
Syndicate content