Tag Archives: linux

Zoneminder Filter Crash

Published by:

My filter won’t run. I wonder why, until today, I found out about the crash of the zmfilter.pl the command to execute the filter. After blogwalking a while I found out about the crash in Arc system. The solution is to create a file called /etc/timezone. The file must contain the location of the timezone. Mine is Asia/Jakarta.
I also do the forum said, I re-link the /etc/localtime to /usr/share/zoneinfo/Etc/GMT+7

Embed rtsp IP Camera to html Code

Published by:

source :

Code :

<!DOCTYPE html>
<html>
<title>Net Surveilance</title>
<body>
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
       width="550"
       height="400"
       id="vlc" />

<script type="text/javascript">
<!--
var vlc = document.getElementById("vlc");
var options = new Array(":aspect-ratio=4:3", ":rtsp-tcp");
var id = vlc.playlist.add("rtsp://192.168.1.55:554/user=USER&password=PWD&channel=1&stream=1.sdp?real_stream--rtp-caching=100", "fancy name", options);
vlc.playlist.play();
//-->
</script>

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
       width="550"
       height="400"
       id="vlc2" />

<script type="text/javascript">
<!--
var vlc2 = document.getElementById("vlc2");
var options = new Array(":aspect-ratio=4:3", ":rtsp-tcp");
var id = vlc2.playlist.add("rtsp://192.168.1.55:554/user=USER&password=PWD&channel=2&stream=1.sdp?real_stream--rtp-caching=100", "fancy name", options);
vlc2.playlist.play();
//-->
</script>

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
       width="550"
       height="400"
       id="vlc3" />

<script type="text/javascript">
<!--
var vlc3 = document.getElementById("vlc3");
var options = new Array(":aspect-ratio=4:3", ":rtsp-tcp");
var id = vlc3.playlist.add("rtsp://192.168.1.2:554/user=USER&password=PWD&channel=3&stream=1.sdp?real_stream--rtp-caching=100", "fancy name", options);
vlc3.playlist.play();
//-->
</script>

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
       width="550"
       height="400"
       id="vlc4" />

<script type="text/javascript">
<!--
var vlc4 = document.getElementById("vlc4");
var options = new Array(":aspect-ratio=4:3", ":rtsp-tcp");
var id = vlc4.playlist.add("rtsp://192.168.1.2:554/user=USER&password=PWD&channel=4&stream=1.sdp?real_stream--rtp-caching=100", "fancy name", options);
vlc4.playlist.play();
//-->
</script>

</body>
</html>

The cctv in my example is located  in 192.168.1.2 port 554 which is a standard port for rtsp protocol.

BackBox Linux Ubuntu 16.04 with sis671 VGA Chipset

Published by:

I had a broken hdd in my laptop 2 days ago. It made me to decide to find another hdd and install my Linux Backbox into it. Something made me worry, I forgot how to set the monitor to the appropriate setting. Then I had to browse the google once more. Here is what I looked for : sis671 driver for my 64bit Backbox.

I manage to find them. Cause I still keep those two in my own repo driver. I copy them to

#sudo cp sis671.la  /usr/lib/xorg/modules/driver
#sudo cp sis671.so  /usr/lib/xorg/modules/driver

Then Everything not goin right. I still have the 480×600 resolution. Then I went to grub setting at boot. I put vga=791 to force the display resolution up. It worked. But I didn’t satisfied, it should not be stop at 1024×768. Before this I manage to have 1280×768. Just I forgot how.

Then Googling again and find out about edid.bin. Actually just a blind guess, cause the source said it was used for nvida driver not my sis671. But what the hell. And sorry source, I forgot to write down your address. I tried to search you again in my history chrome but hell, that’s a lot of them so naaaaaaaa I’ll find you later.

According to the source I copied the edid.bin file to /root. Cause it goes to a reference in xorg.conf. And I also copied the xorg.conf but I modified myself cause it is not nvidia but sis. I will use sis671 driver that I copied earlier.

 

Here is my xorg.conf

Section “ServerLayout”
Identifier “Layout0”
Screen 0 “Screen0” 0 0
InputDevice “Keyboard0” “CoreKeyboard”
InputDevice “Mouse0” “CorePointer”
EndSection

Section “Files”
RgbPath “/usr/X11R6/lib/X11/rgb”
FontPath “/usr/share/fonts/default/Type1”
EndSection

Section “Module”
Load “dbe”
Load “extmod”
Load “type1”
Load “freetype”
Load “glx”
EndSection

Section “ServerFlags”
Option “Xinerama” “0”
EndSection

Section “InputDevice”
# generated from default
Identifier “Mouse0”
Driver “mouse”
Option “Protocol” “auto”
Option “Device” “/dev/psaux”
Option “Emulate3Buttons” “no”
Option “ZAxisMapping” “4 5”
EndSection

Section “InputDevice”
# generated from default
Identifier “Keyboard0”
Driver “kbd”
option “AutoRepeat” “250 50”
option “CoreKeyboard”
option “XkbRules” “xorg”
option “XkbModel” “microsoftnek4k”
option “XkbOptions” “caps:internal_nocancel+lv3(switch)+compose(me nu)”
EndSection

Section “Monitor”
# HorizSync source: xconfig, VertRefresh source: xconfig
Identifier “Monitor0”
VendorName “Unknown”
ModelName “DFP-0”
HorizSync 28.0 – 80
VertRefresh 43.0 – 120
#ModeLine “1440x900_60.00” 106.5 1440 1520 1672 1904 900 901 904 932 -hsync +vsync
Modeline “1280x768_60.00” 79.50 1280 1344 1472 1664 768 771 781 798 -hsync +vsync
Option “DPMS”
EndSection

Section “Device”
Identifier “Videocard0”
Driver “sis671”
VendorName “”
BoardName “”
EndSection

Section “Screen”
Identifier “Screen0”
Device “Videocard0”
Monitor “Monitor0”
DefaultDepth 24
Option “TwinView” “1”
Option “TwinViewXineramaInfoOrder” “DFP-0”
Option “metamodes” “DFP-0: 1440x900_60.00 +0+0, DFP-1: 1440x900_60.00 +1440+0”
Option “MonitorLayout” “TDMS”
Option “CustomEDID” “DFP-0:/root/edid.bin; DFP-1:/root/edid.bin”
SubSection “Display”
Depth 24
EndSubSection
EndSection

Then Reboot.

Oh pay attention to the modeline line in the xorg. I change the original one to my setting. The how to get the modeline is through this command.

#cvt 1280 768

The result will be like this :

# 1280×768 59.87 Hz (CVT) hsync: 47.78 kHz; pclk: 79.50 MHz
Modeline “1280x768_60.00” 79.50 1280 1344 1472 1664 768 771 781 798 -hsync +vsync

Copy and put the result into the xorg.conf. Then reboot again. And my laptop is fine now.

Oh just for the record, not for publishing reason, I didn’t get paid anyway from the manufacturer, I use Axioo Neon MNC 215p.

Backbox – Easy For Newbie As Me

Published by:

Backbox is one of the rar operating system people use. Especially regular people like me. This os is like Kali-Linux. An expert use it as a penetrating tools. Let’s say ethical hacker.. or something. The interfaces and everything is using ubuntu xenial based with lightdm desktop that very convenience to my notebook’s hardware.

Just like Kali, I have not use the penetrating tool yet. I have to learn it carefully though. Anyway this is a good experience, I set up a new goal for my computer expertise.

Kali – rolling Linux sound setting

Published by:

source : https://forums.kali.org/showthread.php?30815-No-sound-how-to-start-pulseaudio-on-startup

1. Turn on Kali Linux, open terminal and type in sudo killall pulseaudio and hit enter. Now type next.

sudo apt-get purge pulseaudio pulseaudio-utils gstreamer0.10-pulseaudio paman pavumeter pavucontrol

and again hit enter.
2. Continue typing and now type rm ~/ .pulse-cookie , after that type rm -r ~/ .pulse and after this type next.

sudo apt-get install alsa-base alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0

and at last type apt-get install kmix and hit enter.
3. And now restart machine.
4. OK now again open terminal and start typing on terminal and type next apt-get install pulseaudio and hit enter and and last type apt-get install gnome-core and again hit enter.
5. Restart machine.
Now you can see the result, all works great, problem solved

by deanMKD1

but in my case, I had to skip some step, like installed alsa-base, which was giving me the non exist message to me. The removing of the folder pulsa-cookie which was not exist.

The other is fine. They make my notebook sound alive.

configuring nfs server and mounting it

Published by:

ibm.com

NFS is one of the secure sharing system in linux. NFS is Network File System. It quite easy to setup, and more simple than samba.
/etc/hosts.allow
portmap: 192.168.1.2
lockd: 192.168.1.2
rquotad: 192.168.1.2
mountd: 192.168.1.2
statd: 192.168.1.2

/etc/hosts.deny
portmap: ALL
lockd: ALL
rquotad: ALL
mountd: ALL
statd: ALL

chmod a+x /etc/rc.d/rc.nfsd
/etc/rc.d/rc.nfsd start

nano /etc/exports
/mnt/sda1 192.168.1.2(rw,no_subtree_check) 92.168.1.3(ro,no_subtree_check)

$exportfs -r
that’s in server

this is in client
mount 192.168.1.1:/mnt/sda1 /home/me/computer1 -o nolock

Removing Zeitgeist Daemon from Ubuntu 12.04

Published by:

Zeitgeist is a service that control the user log.

From Wikipedia:

Zeitgeist is a service which logs the users’s activities and events, anywhere from files opened to websites visited and conversations. It makes this information readily available for other applications to use in form of timelines and statistics. It is able to establish relationships between items based on similarity and usage patterns by applying data association algorithms such as “Winepi” and “A Priori”

Zeitgeist is the main engine and logic behind GNOME Activity Journal which is currently seen to become one of the main means of viewing and managing activities in GNOME version 3.0

I think I want to try to ‘silent’ my laptop so I have no track. So I will uninstall it.

#root:/apt-get purge libzeitgeist-1.0-1 python-zeitgeist zeitgeist-core

Let’s see.

Manage Bandwidth With Squid

Published by:

source : http://s0t4.blogspot.com/2008/11/batasi-bandwidth-dengan-squid.html

Contoh 1

Misalkan dalam network kita perlu untuk memberikan pembatasan-pembatasan bandwidth dikarenakan sumber internet terbatas dan group network lebih dari satu, disusun berdasarkan prioritas.

admin, server dengan bandwidth unlimited
staff dengan bandwidth 1,5 kbytes/sec, bila file yang diakses melebihi 64Kbte
umum dengan bandwidth 1 kbytes/sec, bila file yang diakses melebihi 32 Kbyte

acl all src 0.0.0.0/0.0.0.0
acl admin src 192.168.1.250/255.255.255.255
acl server src 192.168.1.251/255.255.255.255
acl umum src 192.168.1.0/255.255.255.0
acl staff src 192.168.1.1 192.168.1.111 192.168.1.2 192.168.1.4 192.168.1.71

delay_pools 3

delay_class 1 1
delay_parameters 1 -1/-1
delay_access 1 allow admin
delay_access 1 allow server
delay_access 1 deny all

delay_class 2 1
delay_parameters 2 1500/64000
delay_access 2 allow staf
delay_access 2 deny all

delay_class 3 1
delay_parameters 3 1000/32000
delay_access 3 allow umum
delay_access 3 deny all

File konfigurasi squid adalah squid.conf
Aada beberapa tag konfigurasi untuk delay pools di squid.conf.

delay_pools adalah menyatakan berapa banyak bagian/pool yang akan dibuat
misal delay_pools 2
delay_class adalah menentukan klas/tipe pembagian bandwith dari setiap pool. 1 pool hanya boleh memiliki 1 clas, tidak lebih atau kurang.
bagian merupakan nomer urut dari jumlah pool didelay pool, jadi ada 1 s/d n bagian dimana n merupakan angka jumlah pada delay_pools
tipe merupakan tipe class delay yang dipakai.
Secara umum tipe menyatakan bagaimana cara membagi bandwidth, ada 3 tipe:

tipe/class keterangan
1 semua bandwidth yang ada akan dibagi sama rata untuk semua user squid

ex ada bandwidth 128 dan semua bandwith dipakai untuk browsing
2 membatasi pemakaian bandwith dari total bandwidth yang ada, dan bandwith yang diperuntukan squid akan dibagi semua user dengan sama rata.

ex ada bandwidth 128 dimana 28 kbit dipakai untuk email dan sisanya (128-28) 100 kbit dipakai untuk browsing
3 membatasi pemakaian bandwidth dari total bandwidth yang ada, setiap network class C akan mendapat bandwidth sama besar, setiap user pernetwork akan mendapat bandwidth yang sama besar dari total bandwidth per network

 

ex: bandwidth tersedia 512 kb, untuk browsing disediakan bandwidth 384 kb, sisanya untuk aktifitas lain.
Di jaringan tersebut ada 3 departement dengan network yang berbeda misal lab (192.168.1.0/24), manajer(192.168.2.0/24), sales(192.168.3.0/24).
nah misah oleh admin di set bahwa pernetwork mendapat jatah 128 kb/s.
maka user� di sales akan mendapat pembagian bandwidth sama besar dari total 128 kb/s.
maka user� di lab akan mendapat pembagian bandwidth sama besar dari total 128 kb/s.
maka user� di manajer akan mendapat pembagian bandwidth sama besar dari total 128 kb/s.

misal:

delay_class 1 2 # pool 1 memakai clas tipe 2
delay_class 2 3 # pool 2 memakai clas tipe 3

delay_access adalah Memberi batasan siapa saja yang boleh mempergunakan delay pools ini.
Penting untuk diingat sebaiknya setelah menetukan batasan jangan lupa di akhiri dengan deny all.
misal:

delay_access 1 allow manajer delay_access 1 deny all delay_access 2 allow sales delay_access 2 deny all

delay_parameters yaitu :
Ini adalah bagian terpenting dari delay pools memberikan aturan main setiap delay pools yang dibentuk.
delay parameter mempunyai format yang disesuaikan dengan tipe/class yang dipakai.
Tapi disetiap tipe yang dipakai ada 1 format baku yaitu restore/max.

restore menunjukkan maksimum kecepatan data yang dapat dilewatkan bila harga max sudah terlampaui, dalam satuan bytes/second

max menunjukkan besar-nya file atau bucket yang dapat dilewatkan tanpa melalui proses delay. dalam satuan bytes.
Yang perlu diperhatikan dari satuan diatas adalah harga restore dimana kita sering menerima/menyewa/membeli bandwidth dari provider dalam satuan bits/second bukan bytes/second. Sedangkan satuan kecepatan yang ditunjukkan oleh Microsoft pada saat mendonlot file adalah bytes/sec.
Sedangkan satuan dari harga max sudah sesuai dengan kebiasaan sehari-hari, dimana kita memberi besaran bytes pada file-file.
1 byte = 8 bit.

SpesialCase: -1/-1 berarti unlimited atau tidak dibatasi pada nilai restore/max

ex: 1000/64000 harga restore sama dengan 8000 bits/sec atau 8 kbits/sec.
Yang artinya user akan mendapat donlot brustable selama file yang akan dibuka lebih kecil dari 64 kbytes, jadi kecepatan bisa diatas 8 kbit/sec.
Bila ternyata file yang dibuka melebihi 64 bytes, maka proses limitasi akan segera dimulai dengan membatasi kecepatan maksimal 8 kbits/s.

class 1
delay_parameters
ex: delay_parameters 1 1000/64000
Berarti semua network akan mendapat bandwidth yang sama di pool no 1.
Sebesar 1 kbytes/sec (8 kbits/sec), dengan burstable file 64 kb.
class 2
delay_parameters
ex: delay_parameters 1 32000/32000 1000/64000
Berarti squid akan memakai bandwidth maksimum (32000*8) 256kbits dari semua bandwidth.
Bila terdapat lebih dari 1 network class C, maka total yang dihabiskan tetap 256 kbit/sec
dan tiap user akan mendapat bandwidth maksimum 1 kbytes/sec (8 kbits/sec), dengan burstable file 64 kb.
class 3
delay_parameters
ex: delay_parameters 1 32000/32000 8000/8000 1000/64000
Berarti squid akan memakai bandwidth maksimum (32000*8) 256kbits dari semua bandwidth.
Bila terdapat lebih dari 1 network class C, maka setiap network akan dipaksa maksimum sebesar (8000*8) 64 kbits/sec
dan tiap user pada satu network akan mendapat bandwidth maksimum 1 kbytes/sec (8 kbits/sec), dengan burstable file 64 kb.

Bash Script to Execute Mysql Command

Published by:

Here is my bash script to execute msyql command

!/bin/bash
tglblk=$(date –date=”8 days ago” +%Y-%m-%d)
tglhapus=”$tglblk 23:00:00″
SQL=”DELETE FROM Events WHERE EndTime<=’$tglhapus’;”
MYSQL_USER=”root”
MYSQL_PASS=””
MYSQL_DB=”mydb”
echo $SQL | mysql –user=$MYSQL_USER –password=$MYSQL_PASS $MYSQL_DB

Then I put it into crontab to run at specific time.