This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class pagination | |
{ | |
public function __construct() | |
{ | |
} | |
public static function calculate_pages($total_rows, $rows_per_page, $page_num) | |
{ | |
$arr = array(); | |
// calculate last page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fortunately we can modify users list ourselves. :) | |
weldan@prindu:$ telnet 192.168.1.254 | |
Trying 192.168.1.254... | |
Connected to 192.168.1.254. | |
Escape character is '^]'. | |
Username : weldan | |
Password : ******** | |
------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- this is first dropdown, second dropdown will be based on selection from this dropdown --> | |
<form method="post" action=""> | |
<select name="first_dropdown"> | |
<option value="a">a</option> | |
<option value="b">b</option> | |
<option value="c">c</option> | |
</select> | |
<input type="submit" /> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM country | |
ORDER BY | |
CASE WHEN INSTR( name, 'Malaysia' ) =0 | |
THEN 1 | |
ELSE 0 | |
END , INSTR( name, 'Malaysia' ) DESC ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load lampp bin | |
export PATH=${PATH}:/opt/lampp/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global core.excludesfile ~/ignore_files.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import httplib | |
class target: | |
pass | |
parser = argparse.ArgumentParser(description="Test http connection") | |
parser.add_argument('--host', help='Target Hostname', required=True) | |
arguments = parser.parse_args(namespace=target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weldan@prindu:$ telnet 192.168.1.254 | |
Trying 192.168.1.254... | |
Connected to 192.168.1.254. | |
Escape character is '^]'. | |
Username : Remote | |
Password : ******** | |
------------------------------------------------------------------------ | |
______ Thomson TG784n | |
___/_____/\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# port poking with netcat? | |
# weldan, 2013 | |
ip=$1 | |
start=$2 | |
end=$3 | |
if [ $# -ne 3 ] | |
then | |
echo "usage: $0 ip port{start} port{end}" |
NewerOlder