Saturday, January 18, 2014

Finding out largest tables on MySQL Server

mysql> SELECT CONCAT(table_schema, '.', table_name),
    ->        CONCAT(ROUND(table_rows / 1000000, 2), 'M')                                    rows,
    ->        CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G')                    DATA,
    ->        CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G')                   idx,
    ->        CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
    ->        ROUND(index_length / data_length, 2)                                           idxfrac
    -> FROM   information_schema.TABLES
    -> ORDER  BY data_length + index_length DESC

    -> LIMIT  10;

taken from: http://www.mysqlperformanceblog.com/2008/02/04/finding-out-largest-tables-on-mysql-server/

Sunday, January 05, 2014

rapalan mysql akbar :D

mysqlcheck --all-databases -r #repair
mysqlcheck --all-databases -a #analyze
mysqlcheck --all-databases -o #optimize

Tuesday, December 17, 2013

autologin wp

/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
$creds = array();
$creds['user_login'] = 'admin';
$creds['user_password'] = 'passwordente';
$creds['remember'] = true;
$user = wp_signon( $creds, false );
header('Location: http://domainente.com/wp-admin');

Wednesday, November 27, 2013

list fungsi excel

=RANDBETWEEN(DATE(bottomdate),DATE(topdate)
http://www.techrepublic.com/blog/microsoft-office/generate-random-dates-within-a-specific-date-range/
=INDEX($A:$A,RANDBETWEEN(1,COUNTA($A:$A)),1)
http://www.ozgrid.com/Excel/excel-random-pick.htm
fake name generator
http://dailydoseofexcel.com/archives/2006/07/13/random-name-generator/

Saturday, June 22, 2013

rupa-rupa

UPDATE wp_posts SET post_content = replace(tablefield, "datjong24th.com", "24thphoto.com");

du -sk * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done

du -sk .[!.]* * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done

 find /home/ -type f -iname "*.php" -print0 | xargs -0 sha512sum | grep -f /home/bidikdata/analisa-vrs/sidik.data

find -type f -mtime -30 | more

find /home/ -type f -newermt 2013-05-20 ! -newermt 2013-05-25 -iname "*.php" | more


Thursday, June 13, 2013

quota at amazon

http://askubuntu.com/questions/109585/quota-format-not-supported-in-kernel

Sunday, March 31, 2013

macport startup install

###########################################################
# A startup item has been generated that will aid in
# starting logwatch with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.logwatch.plist
###########################################################

Tuesday, March 26, 2013

Simple Search Engine

http://pctechtips.org/a-simple-php-search-engine-tutorial/
http://onlamp.com/pub/a/php/2002/10/24/simplesearchengine.html?page=3

xss and sql injection prevention

//filtering input for xss and sql injection
$input = strip_tags( $input );
$input = mysql_real_escape_string( $input );
$input = trim( $input );

Wednesday, March 06, 2013

Massal optimizing databases

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

Friday, January 25, 2013

serba serbi perintah find

touch -t "20121120" /tmp/start
touch --date "2012-12-15" /tmp/end
find -type f -newer /tmp/start -not -newer /tmp/end

Friday, December 14, 2012

portableapps start.exe error and cannot launch

"PortableAppsPlatform.exe file is not a valid PortableApps.com release and cannot be launched",
when you bump with that error, and recently you cannot install some software (dropbox installer for example). Then you will realize that update process of some software will get failure (mozilla for example).
This problem because you had culprit at your tmp directory.

"C:\Users\netw0rk\AppData\Local\Temp"
It got wrong permission. The normal permission of tmp folder is inherit from parent, so the solution is simple, just check inherit check-box and press OK.

That's it!

glossary:
http://miscee.blogspot.com/2012/11/portableappsplatformexe-file-is-not.html
http://answers.microsoft.com/en-us/windows/forum/windows_8-windows_install/cant-install-multiple-programs/dd263736-cccb-478d-9537-b89af0d554da?page=1


Sunday, December 02, 2012

sudo equivalent for windows

trick that using scheduled task
http://willmtz.blogspot.com/2011/10/how-to-force-application-to-open-in.html
or using runas saved cred
http://www.sevenforums.com/tutorials/193743-elevated-program-shortcut-create-standard-user.html
dunno about this
http://superuser.com/questions/244959/run-as-administrator-shortcut-without-password-prompt

Monday, September 10, 2012

Saturday, September 01, 2012

Catu Daya eksternal Arduino uno

Hari ini agak apes, mbledosno arduino ne arek TA, :P. Jadi bertanya2, catudaya yang aman untuk arduino yang aman ini yang gimana yah?

Monday, August 27, 2012

multiple instance portable firefox

http://www.terminally-incoherent.com/blog/2009/06/11/running-firefox-and-firefox-portable-at-the-same-time/

Tuesday, July 03, 2012

Mounting partitions from full-disk 'dd' images

Forensics: Mounting partitions from full-disk 'dd' images

Published: 2009-08-18,
Last Updated: 2009-08-19 00:26:36 UTC
by Daniel Wesemann (Version: 1)
3 comment(s)
If you are, as I am, a GCFA who attended Rob Lee's famous training in the not-so-recent past, you probably still are "carving out" partitions from within an acquired full disk "dd" image by running it through another "dd". Given how quickly the disk sizes are increasing, this is highly inefficient both in terms of disk space and analyst time used.
But there's a better way. You already know how to use "loopback mount" on Linux to mount an image? Well, loopback mount supports an "offset" parameter that lets you mount a partition directly from within a larger full-disk image. Thusly:

root@ubuntu:/media/disk-1# ls -al
total 39082701
drwxrwxrwx 1 root root 4096 2009-07-12 13:33 .
drwxr-xr-x 4 root root 4096 2009-08-18 19:04 ..
-rwxrwxrwx 1 root root 878 2009-07-07 11:46 fdisk
-rwxrwxrwx 1 root root 701 2009-07-07 11:47 hdparm
-rwxrwxrwx 2 root root 40020664320 2009-07-07 14:34 image-sda
-rwxrwxrwx 1 root root 43 2009-07-07 12:02 md5sum
-rwxrwxrwx 1 root root 43 2009-06-29 13:13 md5sum-sda
drwxrwxrwx 1 root root 0 2009-07-11 19:03 $RECYCLE.BIN
root@ubuntu:/media/disk-1# fdisk -ul image-sda
You must set cylinders.
You can do this from the extra functions menu.

Disk image-sda: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x9c879c87

Device     Boot Start End      Blocks    Id System
image-sda1 *    63    78140159 39070048+ 7  HPFS/NTFS
Partition 1 has different physical/logical endings:
phys=(1023, 254, 63) logical=(4863, 254, 63)

root@ubuntu:/media/disk-1# mount -o ro,loop,offset=32256 -t auto image-sda /media/image
root@ubuntu:/media/disk-1# cd ..
root@ubuntu:/media# cd image
root@ubuntu:/media/image# ls
AUTOEXEC.BAT favorites ntldr Start Menu blp INFCACHE.1 pagefile.sys System Volume Information boot.ini IO.SYS Program Files temp

CONFIG.SYS MSDOS.SYS RECYCLER WINDOWS Documents and Settings NTDETECT.COM spoolerlogs
root@ubuntu:/media/image#


The magic "32256" offset passed to "mount" is easily explained as the start of the partition you are interested in (63 in this case) multiplied by the unit size (512 in this case).  If you have more than one partition, just repeat the above steps for the other slices.
There you go. This easily saves several hours and untold gigabytes of disk space compared to the GCFA "carving out" method.

taken from: https://isc.sans.edu/diary.html?storyid=6991

Friday, June 15, 2012

Mikrotik Vuln

http://www.133tsec.com/2012/04/30/0day-ddos-mikrotik-server-side-ddos-attack/
http://www.133tsec.com/2012/04/27/0day-mikrotik-winbox-client-side-attack-a-remote-code-execution-exploit/

Monday, June 11, 2012

Removing MySQL from OSX Lion


Removing MySQL from OSX Lion

Recently I've had to remove a version of MySQL 5.5 from my Macbook so that I could go back to a 5.1 version. However it appears that there isn't an automatic way to remove and install an older version. A few google searches revealed a bulk of the removal process, but additional searching revealed a few more steps.
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*
vim /etc/hostconfig # and remove the line MYSQLCOM=-YES-
9/28/2011 - added comment on last line. Thanks Justin for pointing this out! 

Web references:
taken from: http://johnmcostaiii.net/2011/removing-mysql-osx-lion/

Sunday, June 10, 2012

Aerosmith - Hole In My Soul

 
I'm down a one way street
With a one night stand
With a one track mind
Out in no man's land
(The punishment sometimes don't seem to fit the crime)

Yeah there's a hole in my soul
But one thing I've learned
For every love letter written
There's another one burned
(So you tell me how it's gonna be this time)

Is it over
Is it over
'Cause I'm blowin' out the flame

Take a walk outside your mind
Tell me how it feels to be
The one who turns the knife inside of me
Take a look and you will find there's nothing there girl
Yeah I swear, I'm telling you girl yeah 'cause
There's a hole in my soul that's been killing me forever
It's a place where a garden never grows
There's a hole in my soul, yeah I should have known better
'Cause your love's like a thorn without a rose

I'm as dry as a seven year drought
I got dust for tears
And I'm all tapped out
(Sometimes I feel broke and can't get fixed)

I know there's been all kinds of shoes underneath your bed
Now I sleep with my boots on but you're still in my head
(And something tells me this time I'm down to my last licks)

'Cause if it's over
Then it's over
And it's driving me insane

Take a walk outside your mind
Tell me how it feels to be
The one who turns the knife inside of me
Take a look and you will find
There's nothing there girl yeah I swear
I'm telling you girl, yeah,
'Cause there's a hole in my soul
That's been killing me forever
It's a place where a garden never grows
There's a hole in my soul
Yeah, I should have known better
'Cause your love's like a thorn
Without a rose

Is it over
Yeah it's over
And I'm blowin' out the flame

Take a walk outside your mind
Tell me how it feels to be
The one who turns the knife inside of me
Take a look and you will find
There's nothing there girl yeah I swear
I'm telling you girl, yeah,
'Cause there's a hole in my soul
That's been killing me forever
It's a place where a garden never grows
There's a hole in my soul
Yeah, I should have known better
'Cause your love's like a thorn
Without a rose