Jumat, 25 Desember 2015

Mikrotik Port Forwarder

Dari menu Winbox  IP -> Firewall -> NAT -> lalu pada menu Tab GENERAL kita tambahkan New NAT Rule, pilih atau setting seperti menu dibawah ini :
• Chain = dstnat (artinya : Destination NAT )
• Protocol = (6)TCP (artinya protocol yang digunakan untuk mengakses ke webserver kita adalah TCP )
• Dst Port =80 (artinya Port 80 digunakan untuk mengakses ke IP Public kita ).
• In Interface = PUBLIC (artinya : interface akses ke Internet, sesuaikan dengan interface yang anda gunakan ).
Selanjutnya pada menu Tab ACTION, pilih atau setting seperti menu dibawah ini :
• Action = dst-nat ( artinya jika memenuhi kondisi seperti pada setting GENERAL maka akan di forward ke IP dibawah ini ).
• To Addres = 192.168.100.100 ( artinya : IP ini adalah IP address alamat tujuan port forwarding jika ada yang mengakses IP Public: 123.231.231.200 ini akan di arahkan ke IP Local: 192.168.100.100
• To Port = 80 ( artinya : Port yang dituju pada IP Local WebServer 192.168.100.100 yaitu Port 80 ).




sumber : https://rudiarya.wordpress.com/2011/01/30/c/


Selasa, 15 Desember 2015

Proftpd

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
Change Otority
chmod o-rwx /etc/passwd
chmod o-rwx /etc/passwd-
chmod 777 /home
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

tutorial belong to : http://diantokam.blogspot.co.id/2012/11/openwrt-proftp-server.html

Sabtu, 12 Desember 2015

Full Backup Firmware

Membuat full backup image openwrt dari Router Aktif (cloning image)
ketika kita telah cape install berbagai packet ke router openwrt, dan router udah ready online. namun ketika di tengah-tengah ada gagal seting, maka kita harus flash dari awal, ato reset menggunakan command "firstboot".

adakah cara lain untuk menyelamatkan image yang telah terinstall berbagai packet yang dibutuhkan, seperti Luci web interface + driver USB modem dll.
awalnya saya tidak yakin menggunakan cara ini, masih bimbang antara router jadi brick atau "on sesuai harapan"
openwrt menyimpan Firmware pada "mtd5" atau tempat menyimpan image yg kita flash ke router ternyata di mtd5. setelah di install berbagai packet-packet juga akan di masukan ke mtd5.
langkah membackupnya bisa login ke router menggunakan command:
cat /dev/mtd5 > /tmp/factory.bin

langkah di atas membuat backup full firmware ke:
file "factory.bin"
dan disimpan
ke folder "/tmp"
simpanlah file image baru tersebut baik-baik di PC. untuk flash ke router kembali, seperti flash image standar saja. bisa upgrade dari Webinterface atau menggunakan winscp untuk copy image ke "/tmp" lalu login pake putty lakukan perintah

cd /tmp && mtd -e firmware -r write factory.bin firmware

Referensi:

Senin, 23 November 2015

Convert GPT to MBR

  1. Turn off the PC, and put in the Windows installation DVD or USB key.
  2. Boot the PC to the DVD or USB key in UEFI mode.
  3. From inside Windows Setup, press Shift+F10 to open a command prompt window.
  4. Open the diskpart tool:
    diskpart
    
  5. Identify the drive to reformat:
    list disk
    
  6. Select the drive, and reformat it:
    select disk <disk number>
    clean
    convert gpt
    exit
    
  7. Close the command prompt window.
  8. Continue the Windows Setup installation.
    When choosing an installation type, select Custom. The drive will appear as a single area of unallocated space.
    Select the unallocated space and click Next. Windows begins the installation.

Jumat, 19 Juni 2015

Jumat, 03 April 2015

Sub Total in Each Row

SELECT [e]+[f] AS masuk, [h]+[i] AS keluar, *
FROM kegiatan_2kas
WHERE a Like '2.2.1.*.*' And key=2012
ORDER BY b;

Order By Split Column


I have a column call it id:
4.1.2.10.0
4.1.2.3.0
4.1.2.4.0
6.1.20.0.0
6.1.3.0.0
...
etc...
What I'd like to do is include an ORDER BY statement that splits the string, to become like this:
4.1.2.3.0
4.1.2.4.0
4.1.2.10.0
6.1.3.0.0
6.1.20.0.0
...
etc....

you should do
select      *
from        tbl
order by    CInt(mid(field1,1,instr(1,field1,'.')-1)),
            CInt(mid(field1,instr(1,field1,'.')+1,instr(2,field1,'.')-1)),
            CInt(mid(field1,instr(3,field1,'.')+1,instr(4,field1,'.')-1)),
            CInt(mid(field1,instr(5,field1,'.')+1,instr(6,field1,'.')-1))

src https://stackoverflow.com/questions/28934055/order-by-split-column

Kamis, 05 Maret 2015

Datagrid Right Click Popup

==========================================================
RIGHT CLICK POPUP

---------------------------------------------------------------------------------------------------
<pre class="brush: csharp">
Private Sub DataGridView1_CellMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseDown
        If e.RowIndex < 0 Or e.ColumnIndex < 0 Or e.RowIndex > DataGridView1.Rows.Count Then
            DataGridView1.ContextMenuStrip = Nothing
            Exit Sub
        End If
        DataGridView1.ContextMenuStrip = ContextMenuStrip1
        If _Daduk.meIdX(DataGridView1.Item(0, e.RowIndex).Value) = False Then Exit Sub
        If e.Button = Windows.Forms.MouseButtons.Right Then
            ContextMenuStrip1.Items(0).Text = _Daduk.Field(3)
            ContextMenuStrip1.Show(Me.DataGridView1, New Drawing.Point(e.X, e.Y))
        End If
    End Sub
</pre>
==========================================================
JIKA SHDK BERUBAH
---------------------------------------------------------------------------------------------------
    Private Sub _list_e_ColChage(ByVal value As String, ByVal rw As System.Data.DataRow, ByVal cl As System.Data.DataColumn) Handles _list.e_ColChage
        If cl.ColumnName = "u" And Microsoft.VisualBasic.Left(value, 1) = "4" Then
            If _list.f_dummy("select * from penduduk where g='" & rw.Item("g") & "'").Rows.Count < 1 Then Exit Sub
            For i As Integer = 0 To _list.f_dummy.Rows.Count - 1
                If _list.f_dummy.Rows(i).Item(19) = "1" Then rw.Item("y") = _list.f_dummy.Rows(i).Item(4) : rw.Item("z") = _list.f_dummy.Rows(i).Item(3)
                If _list.f_dummy.Rows(i).Item(19) = "3" Then rw.Item("w") = _list.f_dummy.Rows(i).Item(4) : rw.Item("x") = _list.f_dummy.Rows(i).Item(3)
            Next
        End If
    End Sub 'SHDK Berubah
===========================================================
DOUBLE CLICK
----------------------------------------------------------------------------------------------------
    Private Sub DataGridView1_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellDoubleClick
        If e.RowIndex < 0 Or e.ColumnIndex < 0 Then Exit Sub
        DataGridView1.DataSource = _list.f_Query("select * from penduduk WHERE g ='" & DataGridView1.Item(6, e.RowIndex).Value & "' order by int(u) ASC,right(n,4) ASC")
    End Sub

Rabu, 18 Februari 2015

LAMP on RASPBERRY Debian

sudo passwd root
---------------------STATIC IP ==============================================
sudo cp /etc/network/interfaces /etc/network/interfaces.sav
sudo vi /etc/network/interfaces

# The loopback interface
auto lo
iface lo inet loopback
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
#your static IP
address 192.168.1.5
#your gateway IP
gateway 192.168.1.1
netmask 255.255.255.0
#your network address "family"
network 192.168.1.0
broadcast 192.168.1.255
sudo /etc/init.d/networking restart
sudo /etc/init.d/networking reload

------------APACHE / PHP==============================================
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2 php5 libapache2-mod-php5 php-pear
sudo groupadd www-data
sudo usermod -g www-data www-data
sudo service apache2 restart
sudo rm -fr /var/www/index.html
sudo echo "<?php phpinfo();?>" >> /var/www/index.php
------------MYSQL ==============================================

sudo apt-get install mysql-server mysql-client php5-mysql
sudo apt-get install phpmyadmin
/etc/init.d/apache2 restart

------------VSFTPD==============================================

sudo chown -R pi /var/www
chmod -R 777 /var/www
chmod -R 777 /var/lib/mysql
sudo apt-get install vsftpd
sudo vi /etc/vsftpd.conf
Change anonymous_enable=YES to anonymous_enable=NO, 
Uncomment local_enable=YES 
Uncomment write_enable=YES
then go to the bottom of the file and add force_dot_files=YES
sudo service vsftpd restart
raspi-config

Jumat, 13 Februari 2015

Wanna buy Microsoft Phone..? Please think twice

http://forums.windowscentral.com/nokia-lumia-521/258178-remove-uninstalled-apps.html

Storage Check details that my Lumia 521 has apps which I have previously 'uninstalled', such as:
Freddy 155 MB
AE Sudoku 98MB
Solitare 56MB
and many more
I've also 'removed' my maps previously downloaded to the phone, and downloaded them again to the SD card, but Storage Check indicates I still have 178 MB on the phone. However when I click on "Maps" in storage check it only shows the downloaded maps on the SD card. Is there a way to free up this space that storage check indicates is being used?

REASON WHY BUY ASHA PHONE IS

memory still limited and can't delete pre-installed application. Are you stupid enough to buy ASHA phone ..? Fuck...!!!!

Delete copyrighted files in nokia

Hi! To delete copyrighted files in nokia you just need to create duplicates of them. For instance if you want to delete the Nokia Tune.aac you just need to copy a file from SD card to other folder in SD Card and rename it using BlueFTP or UC Browser’s file manager as “Nokia tune.aac and copy another file to that folder in sd card now mark both files and and move them to the folder which contains Nokia tune.aac now you will be notified “1 file not moved file name already exist” now press back and go the ringtone folder in phone memory and highlight the nokia tune.aac file press option delete thats it. To delete apps and games first of all you need to create a backup file, goto settings>sync & backup>create backup>mark appsandgames press done. Now open BlueFTP App goto memory card>backup files folder there you’ll see backup000.nbf rename it as ‘backup000.nbf.zip’ now open it and goto predefjava>predefappsandgames there you’ll see folders named Such as ‘ovistore_ovistore_private’ this is the actual file name of nokia store app now write down all the folder names which has ‘_private’ suffixed to their names, now close the backup file. Copy 2 image files to sd card and rename 1 file as ovistore_ovistore without ‘.jpg’ and close BlueFTP App and goto menu>apps>sd card and rename the ovistore_ovistore file by adding ‘.jar’ extension and mark both files and move to my apps folder you ‘ll be notified as 1 file name already exist, now goto my apps and highlight nokia app store app press options and delete.

Kamis, 05 Februari 2015

Exroot OpenWRT on 3020

BESURE THAT FLASHDISK HAS BEEN Formatted
--------------------------------------------------UPDATE
opkg update
opkg install kmod-usb-storage kmod-fs-ext4 block-mount
-----------------------------------------------------MASUKKAN USB
ls /dev/
mkdir -p /mnt/sda2
mount /dev/sda2 /mnt/sda2
mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda2 -xf -
umount /tmp/cproot
umount /mnt/sda2

-----------------------------------------------------EDIT FSTAB
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 /
        option device /dev/sda2
        option options rw,sync
        option fstype ext4
        option enabled 1
        option enabled_fsck 0


config swap
        option device /dev/sda3
        option enabled 1


----------------------------------------------------CEK
/etc/init.d/fstab enable
/etc/init.d/fstab start
reboot
mount
df
-----------------------------------------------------INSTALL DRIVER NTFS
opkg update
opkg install kmod-fs-ntfs ntfs-3g
-----------------------------------------------------RE-EDIT FSTAB
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 /
        option device /dev/sda2
        option options rw,sync
        option fstype ext4
        option enabled 1
        option enabled_fsck 0


config swap
        option device /dev/sda3
        option enabled 1
----------------------------------------------------REBOOT
reboot
mount
df

-----------------------------------------------------INSTALL DRIVER MODEM
opkg update
opkg install kmod-ath9k-htc kmod-carl9170 kmod-rtl8187

Foto Propades