I am going to attend SUST (Shahjalal University of Science and Technology )
Archives
bookmark_borderSiemens-Sk65 udev script for GPRS
When I use GPRS some times my phone move to ttyUSB0 to ttyUSB1 and it disconnect me.
For the details doc: click here
I just add this in my udev.rules
KERNEL==”ttyUSB*”, BUS==”usb”, SYMLINK+=”siemens-sk65″
then in my wvdial.conf
Modem = /dev/siemens-sk65
example:
Jan 16 13:30:29 localhost kernel: usb 4-2: new full speed USB device using uhci_hcd and address 3
Jan 16 13:30:29 localhost kernel: usb 4-2: configuration #1 chosen from 1 choice
Jan 16 13:30:29 localhost kernel: pl2303 4-2:1.0: pl2303 converter detected
Jan 16 13:30:29 localhost kernel: usb 4-2: pl2303 converter now attached to ttyUSB0
Jan 16 13:30:52 localhost kernel: CSLIP: code copyright 1989 Regents of the University of California
Jan 16 13:30:52 localhost kernel: PPP generic driver version 2.4.2
Jan 16 13:30:52 localhost pppd[3339]: pppd 2.4.4 started by root, uid 0
Jan 16 13:30:53 localhost pppd[3339]: Using interface ppp0
Jan 16 13:30:53 localhost pppd[3339]: Connect: ppp0 /dev/ttyUSB0
Jan 16 13:30:55 localhost pppd[3339]: CHAP authentication succeeded
Jan 16 13:30:55 localhost pppd[3339]: CHAP authentication succeeded
Jan 16 13:30:55 localhost kernel: PPP BSD Compression module registered
Jan 16 13:30:55 localhost kernel: PPP Deflate Compression module registered
Jan 16 13:31:25 localhost pppd[3339]: IPCP: timeout sending Config-Requests
Jan 16 13:31:25 localhost pppd[3339]: Connection terminated.
Jan 16 13:31:25 localhost pppd[3339]: Exit.
Jan 16 13:31:33 localhost pppd[3388]: pppd 2.4.4 started by root, uid 0
Jan 16 13:31:33 localhost pppd[3388]: Using interface ppp0
Jan 16 13:31:33 localhost pppd[3388]: Connect: ppp0 /dev/ttyUSB0
Jan 16 13:31:36 localhost pppd[3388]: CHAP authentication succeeded
Jan 16 13:31:36 localhost pppd[3388]: CHAP authentication succeeded
Jan 16 13:31:39 localhost pppd[3388]: Cannot determine ethernet address for proxy ARP
Jan 16 13:31:39 localhost pppd[3388]: local IP address 10.87.9.211
Jan 16 13:31:39 localhost pppd[3388]: remote IP address 192.168.254.254
Jan 16 13:31:39 localhost pppd[3388]: primary DNS address 192.168.80.66
Jan 16 13:31:39 localhost pppd[3388]: secondary DNS address 202.134.13.3
Jan 16 14:07:29 localhost kernel: hub 4-0:1.0: port 2 disabled by hub (EMI?), re-enabling…
Jan 16 14:07:29 localhost kernel: usb 4-2: USB disconnect, address 3
Jan 16 14:07:29 localhost kernel: pl2303 4-2:1.0: device disconnected
Jan 16 14:07:29 localhost pppd[3388]: Modem hangup
Jan 16 14:07:29 localhost pppd[3388]: Connect time 35.9 minutes.
Jan 16 14:07:29 localhost pppd[3388]: Sent 283895 bytes, received 1000779 bytes.
Jan 16 14:07:29 localhost pppd[3388]: Connection terminated.
Jan 16 14:07:29 localhost pppd[3388]: Exit.
Jan 16 14:07:29 localhost kernel: usb 4-2: new full speed USB device using uhci_hcd and address 4
Jan 16 14:07:30 localhost kernel: usb 4-2: configuration #1 chosen from 1 choice
Jan 16 14:07:30 localhost kernel: pl2303 4-2:1.0: pl2303 converter detected
Jan 16 14:07:30 localhost kernel: usb 4-2: pl2303 converter now attached to ttyUSB1
Jan 16 14:07:30 localhost kernel: pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
Jan 16 14:07:41 localhost pppd[3981]: pppd 2.4.4 started by root, uid 0
Jan 16 14:07:41 localhost pppd[3981]: Using interface ppp0
Jan 16 14:07:41 localhost pppd[3981]: Connect: ppp0 /dev/ttyUSB1
Jan 16 14:07:44 localhost pppd[3981]: CHAP authentication succeeded
Jan 16 14:07:44 localhost pppd[3981]: CHAP authentication succeeded
Jan 16 14:07:47 localhost pppd[3981]: Cannot determine ethernet address for proxy ARP
Jan 16 14:07:47 localhost pppd[3981]: local IP address 10.87.10.34
Jan 16 14:07:47 localhost pppd[3981]: remote IP address 192.168.254.254
Jan 16 14:07:47 localhost pppd[3981]: primary DNS address 192.168.80.66
Jan 16 14:07:47 localhost pppd[3981]: secondary DNS address 202.134.13.3
bookmark_borderJava player and streaming server for Ogg
wiki news using it. Link
JOrbis is a pure Java Ogg Vorbis decoder.
===========================
JOrbis accepts Ogg Vorbis bitstreams and decodes them to raw PCM. Link
JRoar is a streaming server for Ogg in pure Java
===================================
JRoar casts live Ogg streams to Ogg Vorbis players as IceCast2 does and shouts live Ogg streams to IceCast2 and JRoar. Link
bookmark_borderThe D Programming Language
bookmark_borderchkrootkit and logcheck
chkrootkit and logcheck mail notification
#apt-get install cron
#crontab /etc/crontab
#apt-get install chkrootkit
write a script ‘chkrootkit’ and save in /
#/bin/bash
cd /usr/sbin/ && ./chkrootkit 2>&1 | mail -s “chkrootkit output” yourname@xyz.com
#chmod 777 / chkrootkit
#apt-get install logcheck
we edit the /etc/logcheck/logcheck.conf
INTRO=1
REPORTLEVEL=”server”
SENDMAILTO=”yourname@xyz.com”
FQDN=1
RULEDIR=”/etc/logcheck”
then we write a script ‘logcheck’ and save in /
#/bin/bash
su -s /bin/bash -c “/usr/sbin/logcheck” logcheck
#chmod 777 /logcheck
we add the chkrootkit and logcheck script in the /var/spool/cron/crontabs/root
46 12 * * * /./chkrootkit
46 12 * * * /./logcheck
done 🙂
bookmark_borderRsync and SSH
This Rsync and ssh is to automatically backup files from one server to another.
for more doc follow this link
We generate a key
$ ssh-keygen -t dsa -b 2048 -f /home/thisuser/cron/thishost-rsync-key
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase): [press enter here]
Enter same passphrase again: [press enter here]
Your identification has been saved in /home/thisuser/cron/thishost-rsync-key.
Your public key has been saved in /home/thisuser/cron/thishost-rsync-key.pub.
The key fingerprint is:
2e:28:d9:ec:85:21:e7:ff:73:df:2e:07:78:f0:d0:a0 thisuser@thishost
Copy the public key to remove PC
$ scp /home/thisuser/cron/thishost-rsync-key.pub remoteuser@remotehost:/home/remoteuser/
Configuring remotehost
$ ssh remoteuser@remotehost remoteuser@remotehost’s password: [type correct password here]
need to make sure we have the directory and files we need to authorize connections with this key
$ if [ ! -d .ssh ]; then mkdir .ssh ; chmod 700 .ssh ; fi
$ mv thishost-rsync-key.pub .ssh/
$ cd .ssh/
$ if [ ! -f authorized_keys ]; then touch authorized_keys ; chmod 600 authorized_keys ; fi
$ cat thishost-rsync-key.pub >> authorized_keys
we edit the ‘authorized_keys’ file (with vi)
before edit
ssh-dss AAAAB3NzaC1kc3MAAAEBAKYJenaYvMG3nHwWxKwlWLjHb77CT2hXwmC8Ap+ fG8wjlaY/9t4uA+2j2yBgN5cy8arlZ80q1Mcy763RjYGkR/FkLJ611HWIA= thisuser@thishost
we made the following change
from=”10.1.1.1″,command=”/home/remoteuser/cron/validate-rsync” ssh-dss AAAAB3Nza
C1kc3MAAAEBAKYBgN5cy8arlZ80q1Mcy763RjYGkR/FkLJ611HWIA= thisuser@thishost
your can omit the ‘from=”10.1.1.1″,’ part of the line (including the comma), then ‘rsync’ will be possible using this key from anywhere.
create a script /home/remoteuser/cron/validate-rsync
#!/bin/sh
case “$SSH_ORIGINAL_COMMAND” in
*&*)
echo “Rejected”
;;
*(*)
echo “Rejected”
;;
*{*)
echo “Rejected”
;;
*;*)
echo “Rejected”
;;
*
bookmark_borderIcecast2 Streaming server
I have test in Debian testing (Sid)
for more doc www.xiph.org
# apt-get install icecast2
edit /etc/default/icecast2
icecast2
=====
ENABLE=true
=====
start the icecast
/etc/init.d/icecast2 start
edit /etc/icecast2/icecast.xml enable the relay if you want.
There are two types of relays: a “Master server relay” or a “Specific Mountpoint relay.” A Master server relay is only supported between icecast2 servers and is used to relays all mountpoints on a remote icecast2 server.
icecast.xml
=======
master-server 127.0.0.1 master-server
master-server-port 8001 master-server-port
master-update-interval 120 master-update-interval
master-password hackme master-password
relays-on-demand 1 relays-on-demand
on-demand 1 on-demand
relay-shoutcast-metadata 1 relay-shoutcast-metadata
example:
relay
server 127.0.0.1 server
port 8001 port
mount /example.ogg mount
local-mount different.ogg local-mount
on-demand 1 on-demand
(if your want to stream the mounted /example.ogg via /different.ogg in server)
========
restart the icecast server
/etc/init.d/icecast2 restart
with your browser
http://localhost:8000/
(user: admin, pass: hackme, by default)
copy a audio.ogg or video.ogg in your “/usr/share/icecast2/web/” and test it with your player.
Ices2 config
(Ogg Vorbis streaming source for Icecast 2)
#apt-get install ices2
cd /usr/share/doc/ices2/examples/
To stream some pre-encoded ogg files
cp /usr/share/doc/ices2/examples/ices-playlist.xml /usr/share/icecast2/web/
edit the /usr/share/icecast2/web/ices-playlist.xml
ices-playlist.xml
==========
hostname localhost hostname
port 8000 port
password hackme password
mount /example1.ogg mount
param name=”restart-after-reread” 1 param (optional)
==========
you can hear it via
http://localhost:8000/example1.ogg
if you change it to /example.ogg,
then you can hear it via
http://localhost:8000/example.ogg
or
http://localhost:8000/different.ogg (via the relay)
create a playlist “playlist.txt” in /usr/share/icecast2/web/
playlist.txt
=======
fordername/01-name.ogg
fordername/02-name.ogg
fordername/03-name.ogg
………………………
=======
start the stream
# ices2 ices-playlist.xml
To stream from Input (alsa or oss)
cp /usr/share/doc/ices2/examples/ices-alsa.xml /usr/share/icecast2/web/
edit the /usr/share/icecast2/web/ices-alsa.xml if your need.
ices-alsa.xml
=========
hostname localhost hostname
port 8000 port
password hackme password
mount /example1.ogg mount
===========
you can hear it via
http://localhost:8000/example1.ogg
if you change it to /example.ogg,
then you can hear it via
http://localhost:8000/example.ogg
or
http://localhost:8000/different.ogg (via the relay)
start the live stream
# ices2 ices-alsa.xml
Video Streaming
#apt-get install ffmpeg ffmpeg2theora oggfwd
example:
#ffmpeg2theora output.ogg -x 320 -y 240 -V 150 -A 64 -o – –optimize | oggfwd localhost 8000 hackme /theora.ogg
(if your want to stream the output.ogg via mountpoint /theora.ogg in icecast server)
play http://localhost:8000/theora.ogg
done 🙂
bookmark_borderQuenix project started again
Yesterday I move to Safura Tower from Stitel for the Quenix project.
From today the project is starting again after being stop about 1 year (8-9 months).
startx…..
bookmark_borderSuccess in Asterisk Clustering
Provide a high-availability (clustering) solution for Linux which promotes reliability, availability, and serviceability (RAS) through a community development effort.
from: http://asteriskprojects.com/?page_id=4
ha.cf
————————————————————
logfacility local0
keepalive 2
deadtime 20
warntime 10
initdead 70
udpport 694
#baud 19200
#serial /dev/ttyS0 # Linux
bcast eth1 # Linux
#ucast eth1 192.168.43.12
auto_failback on
#stonith_host * baytech 10.0.0.3 mylogin mysecretpassword
#stonith_host ken3 rps10 /dev/ttyS1 kathy 0
#stonith_host kathy rps10 /dev/ttyS1 ken3 0
#set kernel “nowayout=0” for that
#watchdog /dev/watchdog
node asterisk1.local asterisk2.local
————————————————————–
haresources
————————————————————–
asterisk1.local 192.168.22.99/24/eth0 drbddisk::shared Filesystem::/dev/drbd0::/share::ext3 drbdlinks mysqld sendmail asterisk httpd munin-node vsftpd ircd xplhub amportal xinetd
————————————————————–
drbd.conf
————————————————————–
global {
}
resource “shared” {
protocol C;
incon-degr-cmd “echo ‘!DRBD! pri on incon-degr’ | wall ; sleep 60 ; halt -f”;
startup {
wfc-timeout 0; ## Infinite!
degr-wfc-timeout 120; ## 2 minutes.
}
disk {
on-io-error detach;
}
net {
# timeout 60;
# connect-int 10;
# ping-int 10;
# max-buffers 2048;
# max-epoch-size 2048;
}
syncer {
rate 10M;
group 1;
}
on asterisk1.local {
device /dev/drbd0;
disk /dev/sda4;
address 192.168.43.11:7789;
meta-disk internal;
}
on asterisk2.local {
device /dev/drbd0;
disk /dev/hda4;
address 192.168.43.12:7789;
meta-disk internal;
}
}
————————————————————–
authkeys
————————————————————–
auth 1
1 crc
#2 sha1 HI!
#3 md5 Hello!
————————————————————–
bookmark_borderGot Gemei X-120 mp4
Got Gemei X-120 mp4 from my Father as a gift.
🙂