Tuesday, December 18, 2012

PDFArchitect

PDFArchitect is a tool to easily modify your PDF files - i.e. you can merge two files, delete pages or rotate them.


PDFCreator

PDFCreator allows you to easily create PDF files from any Windows program. Use it like a printer in Word, StarCalc or any other Windows application.






Images2PDF


Images2PDF is the easy and fast way to convert images to pdf files. You can import different image file types, set different output formats und export all as a pdf file.



DraftSight

DraftSight is a proprietary freeware 2D CAD (computer-aided design or computer-aided drafting) product for engineers, architects, designers, draftspeople, students and educators. The product was developed by Dassault Systèmes and lets users create, edit and view DWG and DXF files.

DraftSight competes against more than three dozen 2D or 2D/3D hybrid products on the market. General availability of DraftSight for Windows was released in February 2011 and was downloaded more than 1.8 million times as of December 2011.

Screenshot


LibreCAD

What is LibreCAD

LibreCAD is a free Open Source CAD application for Windows, Apple and Linux. Support and documentation is free from our large, dedicated community of users, contributors and developers. You, too, can also get involved!

Quick Links:

Wiki : http://wiki.librecad.org
Video Tutorials: http://www.youtube.com/results?search_query=librecad(Big thanks to the tutorial authors)

LibreCAD is a fully comprehensive 2D CAD application that you can download and install for free. There is a large base of satisfied LibreCAD users worldwide, and it is available in more than 20 languages and for all major operating systems, including Microsoft Windows, Mac OS X and Linux (Debian, Ubuntu, Fedora, Mandriva, Suse ...).
You can download, install and distribute LibreCAD freely, with no fear of copyright infringement.

LibreCAD's features

LibreCAD is a feature-packed and mature 2D-CAD application with some really great advantages:
  • It's free – no worry about license costs or annual fees.
  • No language barriers – it's available in a large number of languages, with more being added continually.
  • GPLv2 public license – you can use it, customize it, hack it and copy it with free user support and developer support from our active worldwide community and our experienced developer team.
  • LibreCAD is an Open Source community-driven project: development is open to new talent and new ideas, and our software is tested and used daily by a large and devoted user community; you, too, can get involved and influence its future development.
Screenshot





Friday, December 07, 2012

Checking Connection Via Ping using Bash

Create bash file on the /tmp (you can put anywhere), this is just an example.
$ touch /tmp/ping.sh
added this code inside it
#!/bin/bash
ip=192.168.110.33
ping -c 3 $ip > result
grep 100% result > /dev/null
if [ $? = 0 ]
        # result dari $? kalau 0 artinya tidak output grep di screen
        # artinya, grep tidak mendapatkan apa yang di cari
        # dalam hal ini grep mencari 100% packet loss (host yg off)
        #
        then
        echo "Host off"
        else
        echo "Host on"
fi
Make sure the script has permission to execute
$ chmod +x ping.sh
Test it !
$ sh ping.sh
Result is "Host on" it mean the computer you try to check is a live.
Host on
else computer you try to check is off
Host off
Done

Wednesday, November 28, 2012

Running Rsync as Daemon on Centos 6.2

Configuring /etc/rsyncd.conf
# mcedit /etc/rsyncd.conf
max connections = 2
motd file = /etc/rsync.motd
log file = /var/log/rsync.log
pid file = /var/run/rsync.pid
lock file = /var/run/rsync.lock
timeout = 300
[Test] comment = "Backup Testing" path = /mnt/share uid = root gid = root list = true use chroot = no read only = no list = yes auth users = root, merkurius, venus, jupiter secrets file = /etc/rsyncd.secrets hosts allow = 192.168.1.0/255.255.255.0
Creating the secrets file on /etc/rsyncd.secrets, and add the usernames and the passwords, one per line, separated by a colon (:)
# mcedit /etc/rsyncd.secrets
root:password merkurius:Password venus:passworD jupiter:PassWord
Finally, change the permission of this file so it can't be read or modified by other users.
# chmod 600 /etc/rsyncd.secrets
Edit /etc/xinetd.d/rsync
# mcedit /etc/xinetd.d/rsync
service rsync { disable = no socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID }
Testing from Localhost
# rsyncd root@localhost::
Test "Backup Testing"
or
#rsync rsync://root@localhost
Test "Backup Testing"
Testing from another computer
# rsync -avzr root@192.168.77.194::Test /tmp/test/
Password:******* receiving incremental file list ./ new.txt sent 76 bytes received 216 bytes 83.43 bytes/sec total size is 71 speedup is 0.24
As another user : merkurius
# rsync -avzr merkurius@192.168.77.194::Test /tmp/test/
Password:***** receiving incremental file list ./ install.log sent 81 bytes received 8707 bytes 2510.86 bytes/sec total size is 35011 speedup is 3.98
Check Result
# ls -al /tmp/test/
total 48 drwxr-xr-x 2 root root 4096 Nov 28 17:08 . drwxrwxrwt. 14 root root 4096 Nov 28 17:01 .. -rw-r--r-- 1 root root 34940 Nov 28 17:08 install.log -rw-r--r-- 1 root root 71 Nov 28 16:57 new.txt
As shown above, all file are belong to root, because we specify uid and gid as root, when rsync run as daemon, we can specify which user and group owns the files that are transfer from and to.

Done

Monday, November 26, 2012

Playing MKV Files On Windows Media Player 12 On Windows 7 64 Bit

You will need to install all this application.
1. Install the latest stable version from ffdshow tryout, because some aplication still running on 32 Bit, so i download all ffdshow version :
3. Install Win7DSFilterTweaker

Configuring
1. Running Win7DSFilterTweaker



Here's my setting for Preferred Decoders, checked all ffdshow checkbox (uncheck all Microsoft checkbox).



For Microsoft Codec Tweaks, i disabled all Microsoft Audio and Video Decoder, both 32 Bit and 64 Bit



And for the last setting, i did nothing to it :D


Done

Thursday, November 22, 2012

OpenWRT - miniDLNA Server

Install folowing packages
# opkg install minidlna
# opkg install luci-app-minidlna
Edit /etc/config/minidlna
# vi /etc/config/minidlna
config minidlna 'config'
        option port '8200'
        option inotify '1'
        option notify_interval '900'
        option serial '12345678'
        option model_number '1'
        option root_container '.'
        option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg'
        option interface 'eth0,wlan0'
        option friendly_name 'My DLNA Server'
        list media_dir 'media_dir=A,/home/dlna/audio'
        list media_dir 'media_dir=P,/home/dlna/picture'
        list media_dir 'media_dir=V,/home/dlna/video'
        option db_dir '/home/minidlna/db/'
        option log_dir '/home/minidlna/log/'
        option enabled '1'
Make sure miniDLNA run everytime router booting
 # /etc/init.d/minidlna enable
Start miniDLNA using this command
# /etc/init.d/minidlna start
Use this command to force scan your DLNA server
# /usr/bin/minidlna -f /tmp/minidlna.conf  -d -R
To stop miniDLNA using this command
# /etc/init.d/minidlna stop
Now Open windows Media Player and browse to your DLNA server.




My miniDLNA Setting




OpenWRT - Proftp Server

Install Proftp server
# opkg install proftpd
Edit /etc/proftpd.conf
# vi /etc/proftpd.conf
ServerName "ProFTPD Server" ServerIdent on "FTP Server ready." ServerType standalone DefaultServer on DefaultAddress 127.0.0.1 RequireValidShell off Port 21 UseIPv6 off Umask 022 MaxInstances 10 User nobody Group nogroup AuthUserFile /etc/passwd DefaultRoot /home AllowOverwrite on MaxClients 10 MaxClientsPerHost 10 MaxClientsPerUser 10 MaxHostsPerUser 10 DeleteAbortedStores on UserAlias anonymous ftp
Adding new user for ftp account by editing /etc/passwd, in my case i added user openwrt, copy paste configuration from user ftp, but change user ID number and group name.
# vi /etc/passwd-
root:$1$nvFplbd8$l05HR0mdTHcGprNaMg8QA1:0:0:root:/root:/bin/ash daemon:*:1:1:daemon:/var:/bin/false ftp:*:55:55:ftp:/home/ftp:/bin/false network:*:101:101:network:/var:/bin/false nobody:*:65534:65534:nobody:/var:/bin/false openwrt:*:65538:55:openwrt:/home:/bin/false
Adding password for user openwrt
# passwd openwrt
Enabling proftpd service upon start
# /etc/init.d/proftpd enable
To start proftpd service
# /etc/init.d/proftpd start
To stop proftpd service
# /etc/init.d/proftpd stop
Now start proftpd for debug and access it using ftp client and see if any errors
# proftpd -n -d 10
If everything ok, you should see something similar with this picture when accessing proftpd server


Done

OpenWRT - Samba Server

Install samba36-server and luci-app-samba
# opkg install samba36-server
# opkg install luci-app-samba
Edit /etc/config/samba
# vi /etc/config/samba
config samba
        option name 'OpenWrt'
        option workgroup 'WORKGROUP'
        option description 'OpenWrt'
        option homes '0'

config sambashare
        option name 'dlna'
        option read_only 'no'
        option users 'diantokam'
        option create_mask '0777'
        option dir_mask '0777'
        option path '/home/dlna'
        option guest_ok 'yes'

config sambashare
        option name 'hidden$'
        option users 'diantokam'
        option read_only 'no'
        option create_mask '0777'
        option dir_mask '0777'
        option path '/home/old'
        option guest_ok 'yes'
Edit /etc/passwd and add user diantokam,copy paste user nobody configuration, leave everything same as user nobody, except for user ID and group name.
# vi /etc/passwd
root:$1$nvFplbd8$l05HR0mdTHcGprNaMg8QA1:0:0:root:/root:/bin/ash daemon:*:1:1:daemon:/var:/bin/false network:*:101:101:network:/var:/bin/false nobody:*:65534:65534:nobody:/var:/bin/false diantokam:*:65535:65534:diantokam:/var:/bin/false
Create password for user diantokam
# passwd diantokam
Adding diantokam to samba user
# smbpasswd -a diantokam
Enable samba service on startup
# /etc/init.d/samba enable
To start samba service
# /etc/init.d/samba start
To stop samba service
# /etc/init.d/samba stop
To accesses samba share from windows type \\samba_server_name on address bar, in my case it is \\openwrt



or using  \\ip_address in my case, it is \\192.168.1.1



and insert username and password for diantokam that you give for smbpasswd



Done.

How to Creating Partition table on linux using fdisk

I will create two partitions, the first one for data and one for swap, for data I would use 8 GB. while the remaining 500 MB for the swap. let's get started: D I need to know, where is my disk attached, there is a lot way to know, where is my device attached, but here i use my way :D
# dmesg | grep blocks:
   sd 2:0:0:0: [sda] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB)
   sd 3:0:0:0: [sdb] 16777216 512-byte logical blocks: (8.58 GB/8.00 GiB)
Or
# cat /proc/partitions
   major minor  #blocks  name
   8        0   20971520 sda
   8        1   10240000 sda1
   8        2    1024000 sda2
   8        3    9706496 sda3
   8       16    8388608 sdb
Or
# fdisk -l
Disk /dev/sdb: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdb doesn't contain a valid partition table
Oke, i know my new disk attached to /dev/sdb and i can start creating partititon table on my new disk with following step :
# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe690b018

Start creating first partition, which contains 8GB  data and 500 MB swap
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1044, default 1044): +8000MB 

Creating swap partition
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (975-1044, default 975):
Using default value 975
Last cylinder, +cylinders or +size{K,M,G} (975-1044, default 1044):
Using default value 1044

Choosing swap file type for partition number 2
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap / Solaris)
Write all what you done :D
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
Check what you done :D
# fdisk -l /dev/sdb
Device Boot      Start        End      Blocks   Id  System
/dev/sdb1           1         974     7823623+  83  Linux
/dev/sdb2         975        1044      562275   82  Linux swap / Solaris
Done

Wednesday, November 21, 2012

OpenWrt Attitude Adjustment (Trunk) Exrootfs (Jail Break)

First, plug your external drive to linux and follow this step. Update your packages database
$ opkg update
   Downloading http://192.168.77.246:8080/Packages.gz.
   Inflating http://192.168.77.246:8080/Packages.gz.
   Updated list of available packages in /var/opkg-lists/attitude_adjustment.
Install following package
$ opkg install kmod-usb-core # Kernel support for USB
$ opkg install kmod-usb2 # Kernel support for USB2 (EHCI) controllers
$ opkg install kmod-usb-ohci #Kernel support for USB OHCI controllers
$ opkg install kmod-usb-storage #Kernel support for USB Mass Storage devices
$ opkg install block-mount
$ opkg install kmod-fs-ext4 # Kernel module for the filesystem with which you formatted the partition you want to mount
$ opkg install fdisk # utility to create partitions table
To install package, you can always you this syntax
$ opkg install package_name
Before you step forward, you must prepare your disk partition, i choose fdisk for creating partition table, and i make 3 partition table, two partitions for my data and one for swap file. you can see here for instruction using fdisk. Now, it is time to create filesystem on it, i choose ext3.
$ mkfs.ext3 /dev/sda1 for my data
$ mkfs.ext3 /dev/sda2 for my openwrt rootfs
$ mkswap /dev/sda3 for swap
Next step is create mount point and edit /etc/config/fstab, so every time you restart router, everything back as before :D
$ mkdir -p /home --> mount point /dev/sda1
$ mkdir -p /mnt/rootfs --> mount point /dev/sda2
Editing /etc/config/fstab, my fstab file looks like this
$ vi /etc/config/fstab
config global 'automount'
        option from_fstab '1'
        option anon_mount '1'

config global 'autoswap'
        option from_fstab '1'
        option anon_swap '0'

config mount
        option target '/home'
        option device '/dev/sda1'
        option fstype 'ext3'
        option options 'rw,sync'
        option enabled '1'
        option enabled_fsck '0'
 
config mount
        option target '/mnt/rootfs'
        option device '/dev/sda2'
        option fstype 'ext3'
        option options 'rw,sync'
        option enabled '1'
        option enabled_fsck '0'

config swap
        option device '/dev/sda3'
        option enabled '1'
Reboot it, after reboot check your mount point
$ df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.1M    652.0K    436.0K  60% /
/dev/root                 2.0M      2.0M         0 100% /rom
tmpfs                    14.3M    148.0K     14.1M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3            1.1M    652.0K    436.0K  60% /overlay
overlayfs:/overlay        1.1M    652.0K    436.0K  60% /
/dev/sda1               916.5G    477.8G    392.2G  55% /home
/dev/sda2                97.3M      4.1M     88.1M   4% /mnt/rootfs
Check swap
$free
             total         used         free       shared      buffers
Mem:         29220        24864         4356            0         1660
-/+ buffers:              23204         6016
Swap:        98936          456        98480
Exrootfs - Whole external root (pivot root) Do this on openwrt console
$ tar -C /overlay -cvf - . | tar -C /mnt/rootfs -xf -
$ mkdir -p /tmp/cproot
$ mount --bind / /tmp/cproot
$ tar -C /tmp/cproot -cvf - . | tar -C /mnt/rootfs -xf -
$ umount /tmp/cproot
Reboot After Reboot, check your system mount point and swap memory Before
$ df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.1M    652.0K    436.0K  60% /
/dev/root                 2.0M      2.0M         0 100% /rom
tmpfs                    14.3M    148.0K     14.1M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3            1.1M    652.0K    436.0K  60% /overlay
overlayfs:/overlay        1.1M    652.0K    436.0K  60% /
/dev/sda1               916.5G    477.8G    392.2G  55% /home
/dev/sda2                97.3M      4.1M     88.1M   4% /mnt/rootfs
After
$ df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                  370.4M     15.4M    335.8M   4% /
/dev/root                 2.0M      2.0M         0 100% /rom
tmpfs                    14.3M     88.0K     14.2M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda2               370.4M     15.4M    335.8M   4% /overlay
overlayfs:/overlay      370.4M     15.4M    335.8M   4% /
/dev/sda1               916.5G    477.8G    392.2G  55% /home
Now you have a lot of space to install any applications :D Enjoy it !!

OpenWRT on TP-Link MR3420 v1.2 (OpenWrt Attitude Adjustment 12.09-beta2)

Here's my experiences using OpenWRT on TP-Link MR-3420, i don't posting detail how to upgrade from TP-Link original firmware to OpenWRT firmware, because i think you should know how to upgrade firmware than continue to configuring your new firmware, don't worry, there is a lot information on the net about upgrading firmware from TP-Link firmware to OpenWRT firmware.

Here what i did with my Router Download Firmware OpenWRT untuk MR3420 versi Attitude Adjustment Versi 12.09-Beta2 For fresh upgrade (from TP-Link to OpenWRT)

openwrt-ar71xx-generic-tl-mr3420-v1-squashfs-factory.bin
openwrt-ar71xx-generic-tl-mr3420-v1-squashfs-factory.bin
For system upgrade (from OpenWRT to OpenWRT)
openwrt-ar71xx-generic-tl-mr3420-v1-squashfs-sysupgrade.bin
openwrt-ar71xx-generic-tl-mr3420-v1-squashfs-sysupgrade.bin
My goal is :
1. Create Rootfs on External Storage (Exroot / Jail Break)
2. Having Samba Server on it
3. Also Ftp server
4. And My DLNA server
5. Oh...My 3GS USB Dongle also must be worked on it, and yes, it worked too, even when i used usb hub

And here's my router and StoreJet


Wireless Router TP-Link MR-3420 v1.2.


Transcend StoreJet 1TB


Huawei E173



And Yes, I can have all of it !!




Friday, October 19, 2012

[SOLVED] Getting PostgreSQL 9.1.4 module for PHP-5.4.7 on Slackware 14

Slackware 14 by default carrying PHP-5.4.7 and running smooth well, BUT unfortunately it doesn't come with PostgreSQL, after searching for a while, i decided to install PostgreSQl from scratch.

PostgreSQL 9.1.4 :
SlackBuild : postgresql.tar.gz

Follow this step to compile and install PostgreSQL 9.1.4 on Slackware 14.0 :
1. cd /tmp
2. wget ftp://ftp.postgresql.org/pub/source/v9.1.4/postgresql-9.1.4.tar.bz2
3. Extract SlackBuild script tar -zxvf postgresql-9.1.4.tar.gz
4. Go to Extracted directory cd postgresql-9.1.4
5. Run this command sh postgresql.SlackBuild /tmp/postgresql-9.1.4.tar.bz2
6. After all finish, it will create /tmp/postgresql-9.1.4-i486-1_SBo.tgz
7. Install it using installpkg postgresql-9.1.4-i486-1_SBo.tgz
8. Run this command su postgres -c "initdb -D /var/lib/pgsql/data"
9. Then run this /etc/rc.d/rc.postgresql start
10. Done

Now, the hard part ^^, actually after you find solution, you will said...Hhhmmm just like that hah :D, because PHP-5.4.7 inside Slackware 14 is not compiled using --with=pgsql option, and because i don't want to touch anything about PHP that i'm already set all option and some configuration running smothly on PHP-5.4.7, and also because my server is used for production. the point is, i just want to add pgsql.so into php.ini. That's it, nothing more.

And here is the solution.

PHP-5.4.7 :
SlackBuild : php-pgsql.tar.gz ( I Know this script for PHP-5.4.6, just relax okay ^^ )

Follow my step please :
1. cd /tmp
2. wget http://www.php.net/distributions/php-5.4.7.tar.bz2
3. wget http://slackbuilds.org/slackbuilds/14.0/libraries/php-pgsql.tar.gz
4. Extract SlackBuild script tar -zxvf php-pgsql.tar.gz
5. Go to extracted directory cd php-pgsql
6. Then mcedit php-pgsql.SlackBuild, and change version to correct one (5.4.7)
7. mcedit php-pgsql.info and change, change version and MD5SUM too.
8. Then run php-pgsql.SlackBuild /tmp/php-pgsql.tar.gz
9. After finish, you should get /tmp/php-pgsql-5.4.7-i486-1_SBo.tgz
10. Installpkg /tmp/php-pgsql-5.4.7-i486-1_SBo.tgz
11. Enable pgsql module by editing mcedit /etc/php/pgsql.ini and enable extension=pgsql.so by removing ;
12. Done

Proved :
root@slackware:~/Desktop# php -m | grep pgsql
If everything okay, you will get pgsql as result.

My info.php


Saturday, October 06, 2012

Connect to Rsync Server on Windows 7 (64 Bit)

I have combined some simple tool for running Rsync server on Windows 7, i took them from various poppular project like Cygwin, CwRsync, and Instant WIndows Rsync Server from Winsupport, and to make my life simple i created some simple script and config file to running Rsync server.

Here my simple script to runnig Rsync server on Windows 7 :

@echo off
rem
rem Ask which drive is to be shared and create the rsyncd.conf file.
rem
cls
echo.
echo INSTANT RSYNC SERVER
echo.
echo.
echo * * * W A R N I N G * * *
echo.
echo No security is used on this rsync server. Anyone will be able to
echo connect to rsync share and copy files. Be sure to cancel the rsync
echo server when you are finished.
echo.
echo.
echo.Close this windows to stop Rsync Server !!!
echo.
rsync.exe --config rsyncd.conf --daemon --no-detach

And here is my rsyncd.conf

use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#
[test]
path = /cygdrive/D/server
read only = false
transfer logging = yes

And save it as rsync.bat  and double click it to run rsync server. soon after double click it you will see the Dos Prompt window show up. Close that windows to stop rsync server.


Now it is time to check our new rsync server.

From windows command promt (Windows to Windows) :
rsync.exe 192.168.110.131::
The output should test


Now, i will try to transfer file to rsync server via rsync client on my windows :
rsync -avz /cygdrive/d/client 192.168.110.131::test/ 
Cygdrive/D mean Drive D, cygdrive/d/client mean D:\client 

And yes, my files transferred ^^.

From Linux Console (Linux to Windows) :

Testing connection to Rsync server on Windows and the result is test, it mean oke
Transfering file from linux to windows :
rsync -avz crontab-script/ 192.168.110.131::test/

As you can see, it worked too ^^

In Linux world you don't need type /cygdrive/x because cygwin want emulate linux environment on windows, that why it created some layer to accesses windows drive using /cygdrive/windows_drive.

Thursday, September 27, 2012

Running Rsync Server as Service on Windows 7 (64 Bit)

What if i want running Rsync server as service on Windows, here :
cygrunsrv -I "RSYNC" -d "Rsync daemon" -p rsync.exe -a "--config=rsyncd.conf --daemon --no-detach" -f "Fast incremental file transfer"
This command will create Rsync daemon service on Windows 7

To start service you can type
cygrunsrv.exe  --start rsync

To stop service you can type
cygrunsrv.exe  --stop rsync


Running Rsync as Daemon on Windows 7 (64 Bit)


After few days strungle with Bash and Rsync on Windows, I decided to combine some tools from main package, because i only need Bash, Rsync and some linux tols to run on Windows 7, and here my experience.

Altought many site said that Rsync only need, this package :
  • Rsync.exe - the executable program
  • cygwin1.dll - the main library file needed by all Cygwin programs
  • cygpopt-0.dll - the library for handling command-line options

In fact, Rsync.exe (Rsync Version 3.0.9) still need one file cygiconv-2.dll, so here's my completed file for running Rsync Version 3.0.9 on Windows 7 (64 Bit).
  • Rsync.exe - the executable program
  • cygwin1.dll - the main library file needed by all Cygwin programs
  • cygpopt-0.dll - the library for handling command-line options
  • cygiconv-2.dll - the library to handling command-line option, also necessary to implement emulator functionality

After all tools complete collected on one folder, i starting create Rsync.conf, a file that contain some neccessary configuration to start Rsync server, and here my Rsync.conf :
use chroot = false
strict modes = false
hosts allow = *
log file = Rsyncd.log
# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
[test]
path = /cygdrive/D/
read only = false
transfer logging = yes
after configurating Rsync, it's time to running Rsync server with this simple command
Rsync.exe --config=Rsyncd.conf --daemon --no-detach
that command will bring up Windows DOS Prompt Windows, to stop the Rsync server is simple, just close the Windows Prompt.

To check if your Rsync server running or not, is simple to, from Windows DOS Promt, type the following command :
Rsync.exe localhost::
If you see "test" as output, then your Rsync server is running.

Simple Hah ^^

rsync files

Saturday, September 08, 2012

Part-04 Create Cron Jobs

After creating batch file, this time we would like to run that batch file every time we need it, that why we need Cron.exe from kolab.com. as explain in kolab.com, to setup cron.exe is very simple way, it just take 3 step.

  1. copy the files cron.exe and crontab to a folder of your choice
  2. edit the file crontab (see the examples as a reference)
  3. create a link to cron.exe and move it to the startup folder
Just follow that 3 step and everything would be okay. and here i will copy paste explanation from kolab.com

The Crontab file
Each line of CRONTAB has the following structure:

Position:
Values:
Minute0-59
Hour0-23
Day1-31
Month1-12
Day of week0-6 (0=Sunday, 1=Monday, ..., 6=Saturday)

Instead of minute, hour, day, month or day of week it's also possible to specify a *. A * represents all possible values for that position (e.g. a * on 2nd position is the same as specifying all the possible values for hour)

It's also possible to specify several values separated by commas: e.g. if you want a command to be executed every 10th minute so you can specify 0,10,20,30,40,50 for minute. A range of values can be specified with a -: e.g. value 0-12 for hour -> every hour a.m.
Comments

Every line not starting with a number is treated as a comment.

Examples
execute a command every minute
# This is a comment.
* * * * * c:\tools\CheckForNewFiles.exe

execute the program backup.bat every hour
# This is a comment.
0 * * * * c:\tests\backup.bat

do a backup every day at 0.30 p.m.
# This is a comment. 30 12* * * c:\tests\backup.bat

start a backup every tuesday at midnight
# This is a comment.0 0 * * 3 c:\tests\backup.bat

scan drive c for viruses on the 1st of every month at 2.45 p.m.
# scan for known viruses45 14 1 * * c:\path_to_scanner\scan c:

copy some files every half hour 
# This is a comment.0,30 * * * * xcopy c:\docs\*.* y:\users /s

copy a file every hour (a.m.) only on weekdays
# System commands need the command interpreter specified:0 0-12 * * 1-5 c:\...\cmd.exe /c "copy c:\... e:\"


for another great information for crontab scheduling is wikipedia

Part-03 Creating Batch File

Part-03 Creating Batch File

Oke, after downloading all aplication and create some backup profile, this time we would like to create batch file, so every backup profile that already created will be running  in sequence. and here's the bacth file i created for my backup profile, change as needed.

@echo off
start/wait D:\ProgramsApps\Deltacopy\DeltaC.exe 002009.dcp
start/wait D:\ProgramsApps\Deltacopy\DeltaC.exe 002010.dcp
start/wait D:\ProgramsApps\Deltacopy\DeltaC.exe 002011.dcp
start/wait D:\ProgramsApps\Deltacopy\DeltaC.exe 002012.dcp
start/wait D:\ProgramsApps\Deltacopy\DeltaC.exe 002013.dcp

and save it with name DeltaC.bat

Explenation :

start/wait Start application and wait for it to terminate
D:\ProgramsApps\Deltacopy\DeltaC.exe is my aplication location/path, change as needed
002009.dcp and another *.dcp file is file that holding backup profile name

In simple way start/wait D:\ProgramsApps\Deltacopy\DeltaC.exe 002009.dcp , it's command windows to run DeltaC.exe from it location and running 002009.dcp backup profile.

Part-02 Create Backup Profile

After downloading all aplication, it's time to me to create backup profile using deltacopy (DeltaC.exe), double click DeltaC.exe and create backup profile as you need:

Step-01 : Create backup profile, Just give profile name as you like, in host name field insert with your rsync server name or ip, and for directory name insert with backup location (diretory) on your rsync server. Don't check Assign to scheduler because we would like to use Cron.exe as Task Scheduler.


Step-02 : File list, replace it with the file that you want to backup


Step-03 : for file option, i don't change anything except additional parameters, in this field i put : --exclude='Thumbs.db' --exclude='.DS_Store' --exclude='._*' --exclude='Desktop.ini' --exclude='*.lnk'



Step-04 : In authentication, put username and password that you allow to connect to your rsync server, this configuration is done on server side.


Step-05 : This is only optional choice, do it only if you want notified by email for every backup profile you created, in this example i use my local email server.


make sure you click on Test Email button to test your email notification, if you got display like bellow, it means your setting is correct, if not...than find it by your self :D

Part-01 Create Backup from Windows To Linux Via Rsync and Cron

After a months searching and researching to create simple and clean backup strategy, i found cool and simple solution  for backing up from windows 7 (64 bit) to Linux server running Rsync server, and here's my backup startegy.

Why i would like to use portable application? Because windows every aplication you installed on your windows system will leave a lot of registry junks. that why i choose deltacopy (unzip mode0 and another one. which is free and gpl. as the website said :

In general terms, DeltaCopy is an open source, fast incremental backup program. Let's say you have to backup one file that is 500 MB every night. A normal file copy would copy the entire file even if a few bytes have changed. DeltaCopy, on the other hand, would only copy the part of file that has actually been modified. This reduces the data transfer to just a small fraction of 500 MB saving time and network bandwidth.

And here's the download links

I used only client software because i don't want to running backup server on windows.

and to schedule the rsync backup, i would like to use Cron.exe from kalab.com (mirror), once again, i don't want use windows task scheduler, it's suck program that only running on administrator mode ( not user mode) that way  i use Cron.exe, clean and simple, and the finnest part is, the contab configuration file is compatible with linux crontab. as the web site said :

Cron scans the file CRONTAB every minute and checks every line if the specified time/date information matches the current time/date. If they are equal, the command line specified will be executed. A log file (cron.log) with the executed commands is written to the current directory.

After combining all of that aplication, i got this usefull aplication.

And how i do automatic backup using windows batch? see you on Part-02

Part-02 Create Backup Profile

Saturday, August 25, 2012

Membuat Email Palsu

Langsung saja praktek, ga pakai lama :D, login ke linux server yang memiliki koneksi internet.

Telnet ke linux server dengan port 25 yang merupakan port untuk SMTP (protokol untuk mengirimkan email).
[root@jupiter ~]# telnet jupiter.anekakecap.lan 25
Trying 192.168.110.242...
Connected to jupiter.anekakecap.lan.
Escape character is '^]'.
220 chronos.anekakecap.lan ESMTP Postfix

Mulai menulis email
MAIL FROM: undian@cimbniaga.com
250 2.1.0 Ok
RCPT TO: magnetux@yahoo.com
250 2.1.5 Ok
DATA
354 End data with .
To: magnetux@yahoo.com
From: undian@cimbniaga.com
Subject: Selamat, Anda Menang Undian
Selamat Anda Menang undian 3 Milyard, hadiah akan segera di transferkan ke Rekening anda paling lambat 1 minggu setelah email ini.

Bila selesai tekan tombol titik (.) dan enter
.  <--- ini titik loh ^^

Untuk mengakhiri telnet ketikkan quit dan tekan enter
250 2.0.0 Ok: queued as 88F9A8C00B
quit
221 2.0.0 Bye
Connection closed by foreign host.

Silahkan membuka inbox anda ^^

Digital Forensik - Menelusuri Asal Muasal Email

Suatu hari anda mungkin pernah mendapatkan email seperti dibawah ini,
Selamat Anda Menang undian 3 Milyard, hadiah akan segera di transferkan ke Rekening anda paling lambat 1 minggu setelah email ini.
Atau email lainnya yang mengatakan anda mendapatkan undian ataupun harta warisan yang sangat banyak nilainya, Uuuppss....jangan senang dulu, karena di dunia digital hampir tidak ada yang mustahil, mustahil atau tidaknya hanya dibatasi oleh kemampuan dan teknologi yang ada saat ini.

Mari kita langsung bahas email yang saya terima pagi ini ^^,  silahkan lihat gambar dibawah ini :


Bagi banyak orang yang tidak paham masalah penipuan di dunia digital mungkin akan langsung mengadakan tumpengen untuk syukuran :D, namun sebaiknya kita telusuri dulu kebenaran email ini.

Email diatas hanya contoh yang dibuat oleh saya sendiri, jadi isinya memang tidak menunjukkan profesionalisme, karena yang akan dibahas bukan isinya, namun asal muasalnya ^^

Sebelum memulai bahasan singkat mengenai asal muasal email tersebut, kita harus paham dulu perjalanan si surat elektronik ini. email sama dengan surat yang dikirimkan via kantor pos. bila perjalanan surat itu jauh, misalkan kita kirim surat dari Surabaya ke Palangkaraya, maka surat tersebut akan melewati beberapa kantor pos (surat dikirmkan secara estafet via kantor pos) dan setiap memasuki kantor pos, surat tersebut akan di stempel sampai akhirnya sampai ke tangan si penerima, kalau tidak percaya coba lihat surat milik bapak / ibu masing, pasti ada stempel diatas prangkonya ^^.

Contoh surat yang mengalami perjalanan jauh
sehingga banyak stempel dari kantor pos yang disinggahinya

Nah...email juga sama, dalam pengiriman email, terdapat dua komponen dasar yang penting :
  • MUA (Mail USer Agent) sebagai interface dalam penulisan email tersebut, misalkan Thunderbird, Seamonkey, Opera, Outlook, maupun Webmail.
  • MTA (Mail Transfer Agent) yang bertugas mengirimkan email sampai ke tangan penerima, semacam Postfix, Sendmail, Qmail, dll, fungsinya sama dengan Kantor Pos dalam pengiriman surat, yang bertugas mengirimkan email dan memberi stempel pada email yang kita kirim.
Oke...sekarang back to email, kali ini saya akan memakai yahoo mail, karena email ini saya terima di yahoo mail. untuk mengetahui surat ini asli dari cimbniaga.com atau tidak, kita harus melihat stempel yang tertera pada email ini, dalam hal ini disebut header.

Untuk melihat header email di yahoo mail lihat gambar dibawah ini.



Dengan alasan kenyamanan MUA tidak akan menampilkan header dari email, namun kita masih bisa melihatnya, berikut saya akan sertakan header email tersebut, dan cara membaca header email adalah dari bawah ke atas.

Header email dari email diatas

From undian@cimbniaga.com Sat Aug 25 13:54:50 2012
X-Apparently-To: magnetux@yahoo.com via 106.10.174.133; Fri, 24 Aug 2012 22:23:10 -0700
Return-Path:
X-Originating-IP: [123.231.238.245]
Authentication-Results: mta1229.mail.ac4.yahoo.com from=cimbniaga.com; domainkeys=neutral (no sig); from=cimbniaga.com; dkim=neutral (no sig)
Received: from 127.0.0.1 (EHLO chronos.anekakecap.lan) (123.231.238.245)
by mta1229.mail.ac4.yahoo.com
with SMTP; Fri, 24 Aug 2012 22:23:09 -0700
Received: from jupiter.anekakecap.lan (jupiter.anekakecap.lan [192.168.110.242])
by chronos.anekakecap.lan
(Postfix) with SMTP id 88F9A8C00B
for ; Sat, 25 Aug 2012 01:54:50 -0400 (EDT)
To: magnetux@yahoo.com
From: undian@cimbniaga.com
Subject: Selamat, Anda Menang Undian
Message-Id: <20120825055501 .88f9a8c00b=".88f9a8c00b" chronos.anekakecap.lan="chronos.anekakecap.lan">
Date: Sat, 25 Aug 2012 01:54:50 -0400 (EDT)
Content-Length: 132
Selamat Anda Menang undian 3 Milyard, hadiah akan segera di transferkan ke Rekening anda paling lambat 1 minggu setelah email ini.
                                                                                                                                                                                                                                                            
Email diatas seolah-oleh berasal dari cimbniaga.com, namun kalau kita telusuri dengan teliti, maka email tersebut tidak pernah singgah di cimbniaga.com sama sekali, mari kita lihat dengan lebih teliti lagi ^^
  • Received: from jupiter.anekakecap.lan (jupiter.anekakecap.lan [192.168.110.242]) by chronos.anekakecap.lan  artinya: sesorang dari jupiter.anekakecap.lan menulis email tersebut dan dikirimkan ke  "kantor pos" chronos.anekakecap.lan.
  • Received: from 127.0.0.1 (EHLO chronos.anekakecap.lan) (123.231.238.245) by mta1229.mail.ac4.yahoo.com  with SMTP artinya: email tersebut dikirimkan ke mta yahoo.com oleh chronos.anekakecap.lan
  • Dan akhirnya email yang seolah-olah dari CIMB Niaga tersebut sampai ke tangan si penerima.
Dari header tersebut tampak kalau email tersebut tidak pernah mampir ke CIMB Niaga, jadi kesimpulannya email tersebut palsu :).