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

Sabtu, 25 Oktober 2014

Give Apache Own User

CENTOS
--------------------------------------------------------------------------------------
Add a user (who isn’t root)
Add a new user to the wheel and apache groups. The wheel group gives root/sudo access. The apache group allows both user and apache to write to your website files. The -G tells useradd we want to add to multiple groups. Sam is the username in this example.
useradd -G wheel,apache us3r
passwd us3r
Set directory and file permissions
Make apache the owner of /var/www. The -R makes the ownership changes recursive (apply to all files and directories within /var/www.
The syntax here is user:group. All users automatically have a group of the same name (e.g. user sam has a group called sam).
chown -R apache:apache /var/www
Change the permissions to give the owner (apache) and members of the apache group write permission (775).
find /var/www/ -type f -exec chmod 664 {} \;
find /var/www/ -type d -exec chmod 775 {} \;
Now resecure /var/www by giving it back to root or the user you created earlier.
chown root:root /var/www
View/confirm directory ownership/permissions with the ls -lcommand.
ls -l /var
ls -l /var/www
If you prefer editing long config files via S/FTP in a desktop text editor like Coda, take ownership of the following.
chown sam:sam /etc/php.ini 
chown sam:sam /etc/my.cnf 
chown -R sam:sam /etc/php.d
chown -R sam:sam /etc/httpd
Give your new user root privileges
Start by using a special text editor visudo by issuing the following command.
visduo
Enable the wheel group by uncommenting the following line like so.
## Allows people in group wheel to run all commands
%wheel        ALL=(ALL)       ALL
Alternatively, uncomment the next line to enable the wheel group and allow these user to become root without having to renenter their password.
## Same thing without a password
%wheel        ALL=(ALL)       NOPASSWD: ALL
Now logout of your SSH session, then test logging in as the new user.
logout
ssh sam@YOUR_IP_HERE
Test that the new user can become root.
sudo su -
The # should change to & and the user should show root@YOUR_HOSTNAME. Now logout of root to get back to your user.
logout
For reference, you can also execute single line commands as root by prefixing with sudo e.g.
sudo visudo

source http://whatsamknows.tumblr.com/post/40245741052/centos-lamp-permissions


Rabu, 22 Oktober 2014

SQL Debet, Kredit, Saldo

MYSQL
mysql> select @s:=0;
+-------+
| @s:=0 |
+-------+
|     0 |
+-------+
1 row in set (0.00 sec)
 
mysql> select @k:=if(kode="k",nominal,0) as Kredit,@d:=if(kode="d",nominal,0) as
 debet, @s:=@s+@k-@d as saldo from trx;
+--------+-------+-------+
| Kredit | debet | saldo |
+--------+-------+-------+
|   3434 |     0 |  3434 |
|   3434 |     0 |  6868 |
|   4434 |     0 | 11302 |
|      0 |   544 | 10758 |
|      0 |   453 | 10305 |
+--------+-------+-------+
5 rows in set (0.00 sec)
MSSQL..?
belong to: http://mozzamediart.wordpress.com/2012/08/04/query-mysql-menghitung-saldo-per-transaksi/