http://www.joshparker.us/php/securely_hashing_passwords_with_php.html
(Read More..)Sabtu, 29 Desember 2012
Jumat, 28 Desember 2012
gemicon
Gemicon is handcrafted icon set by Turqois,
which there 3 different sizes (16, 32, 64). Each icon created with
pixel-perfect shape layer on Photoshop. Download and get PNGs and PSDs
file.
Oh yes, it's FREE and suitable to implement here and there for your
next awesome project!
http://gemicon.net/
Rabu, 26 Desember 2012
php_fpm, nginx, php_value, and multiple values
MadMACs: MAC Address Spoofing and Host Name Randomizing App for Windows 7 (Should work in Windows Vista and Windows 8 too)
Minggu, 23 Desember 2012
Terminal Eye Candy
Sabtu, 22 Desember 2012
Cooperative multitasking using coroutines (in PHP!)
Be productive with the MySQL command line
Jumat, 21 Desember 2012
ppl The command line address book
ppl is free software made out of other free software. It's built on top of
Ruby and Git, and the completely free vcard address book format. Even your
phone can probably speak vcard.
http://ppladdressbook.org/
fabric - ssh
Fabric is a Python (2.5 or higher) library and command-line tool for
streamlining the use of SSH for application deployment or systems
administration tasks.
It provides a basic suite of operations for executing local or remote shell
commands (normally or via sudo) and uploading/downloading files, as well as
auxiliary functionality such as prompting the running user for input, or
aborting execution.
Typical use involves creating a Python module containing one or more functions,
then executing them via the fab command-line tool. Below is a small but
complete “fabfile” containing a single task:
http://docs.fabfile.org/en/1.5/
Attacking Ruby Session
Ruby on Rails Sessions
http://phenoelit.org/blog/archives/2012/12/21/let_me_github_that_for_you/index.html
(Read More..)Minggu, 16 Desember 2012
REDISLIVE
Visualize your redis instances, analyze query patterns and spikes.
https://github.com/kumarnitin/RedisLive
Sabtu, 15 Desember 2012
prettyPrint.js
prettyPrint.js is an in-browser JavaScript variable dumper, similar in functionality to ColdFusion's cfdump tag.
First, a preview:
https://github.com/padolsey/prettyPrint.js
GAS - Google Analytics on Steroids
GAS is a wrapper around the Google Analytics Tracking API from Google. It tries
to add new functionality while keeping the same API.
GAS is not an official Google library and GAS developers are not affiliated
with Google.
Installation
To install GAS download the script from download page and put it somewhere on your website. Also install the basic snippet on every page of your website. Be sure to change the Account Number (UA) and the correct gas.js file location.You can also use gas hosted on cdnjs.
The basic snippet looks like this:
https://github.com/cardinalpath/gas (Read More..)
Tweetable PHP-Non Alpha
I started to try and break the 10 charset limit of PHP non-alpha
after @InsertScript showed me that PHP Dev supports [] syntax for
arrays. I wondered if it would be possible to break the limit within
production PHP. At first I thought you could but then after some testing
I found that there was no way to concat without “.” and no way to call a
string as a function without $ and =. However since I got into PHP
Non-alpha again I thought why not try and improve it and make the code
tweetable.
The first hack I found was that underscore is usable in PHP as a
string since there is a function called “_”. Therefore we can create 0
by simply doing:
echo +_;
You can also create numbers and arrays using undefined variable references like so:
echo ++$_[];//prints 1
http://www.thespanner.co.uk/2012/12/13/tweetable-php-non-alpha
Persistent Terminal Sessions
Have you ever had a remote terminal session running, only to have
your connection drop out half way through a large task? Then, you
reconnect, not knowing anything about its progress (if any) and current
status.
Screen
is the solution to this problem. Screen allows you to start terminal
sessions that you can disconnect from and resume at any time.
I personally use screen a lot with Node.js
web servers, so I can kick off the process, and resume my terminal
session to check logs or errors, or restart the process if it died.
This article is an introduction to Screen for the average developer, including a few tips and tricks.
Installing
Screen is a Unix tool, so with Ubuntu, you can useapt-get
to install it:sudo apt-get install screen
http://webadvent.org/2012/persistent-terminal-sessions-by-remy-sharp
(Read More..)
CentOS / RHEL: Install ipset Administration Tool For IP Sets and IPTables
15 Greatest Open Source Terminal Applications Of 2012
Linux / Unix: Test Internet Connection Speed From Console Over SSH Command Line
Non-persistent connection performance improvements in 5.6
Jumat, 14 Desember 2012
TraceKit
Tracekit is a JavaScript library that automatically normalizes and exposes stack traces for unhandled exceptions across the 5 major browsers: IE, Firefox, Chrome, Safari, and Opera.
https://github.com/occ/TraceKit
(Read More..)DevTools tip: You can replay any XHR (POST or GET) within the Network tab in an XHR's context menu: http://t.co/1yjrMnjj
DevTools tip: You can replay any XHR (POST or GET) within the Network tab in an XHR's context menu: http://t.co/1yjrMnjj
(Read More..)Linux now supports full stack TCP Fast Open (http://t.co/hiooot2a) as for 3.7 http://t.co/r29f1C4M . TCP can be as fast as UDP!
Linux now supports full stack TCP Fast Open (http://t.co/hiooot2a) as for 3.7 http://t.co/r29f1C4M . TCP can be as fast as UDP!
(Read More..)Return Multiple Values From A Delphi Function
Porting of cURL to Android OS using NDK
Minggu, 09 Desember 2012
Watch.js 1.2.0
Watch.JS is a small library that brings a lot of possibilities. You may
know that the "Observer" design pattern involves executing some function
when an observed object changes. Other libraries exist that do this,
but with Watch.JS you will not have to change the way you develop. Take a
look at the examples to see how simple it is to add Watch.JS to your
code.
https://github.com/melanke/Watch.JS
timer.js
Timer.js is a periodic timer for Node.js and the browser.
https://github.com/fschaefer/Timer.js
oolib.js
oolib.js is a tiny JavaScript library that provides an original
solution to the age-old problem of JavaScript OOP encapsulation. It
offers the following features:
- Real encapsulation of object fields and private methods.
- Class inheritance. (The fields and private methods are accessible by the subclasses.)
- Support of object initialization and deinitialization.
- Super method call.
- Intuitive syntax.
- Only 1.9 kilobytes minified / 0.9 kilobytes gzipped.
http://idya.github.com/oolib/ (Read More..)
echo "foo:bar" | chpasswd #Quickest way to change password for user 'foo' to 'bar' under Linux/change a users password inside a script.
echo "foo:bar" | chpasswd #Quickest way to change password for user 'foo' to 'bar' under Linux/change a users password inside a script.
(Read More..)Numeral.js
http://numeraljs.com/ (Read More..)
tabIndent.js
he following textarea has been enhanced with tabIndent.js,
so that the tab key no longer takes you to the next input, but rather, acts like a text editor by inserting a tab character.
Multi-line highlighted text is also tab-able, and shift-tab removes a tab character instead.
http://julianlam.github.com/tabIndent.js/
AURA PHP
The Aura project provides independent library packages for PHP 5.4+.
These packages can be used alone, in concert with each other, or
combined into a full-stack framework of their own.
http://auraphp.github.com/
Common Linux tools on Android without root by installing BusyBox
Replication of the NOW() function (also, time travel)
Linux / Unix Command To Optimize and Compress PNG Files In Bulk
Linux: GNU/Screen Scroll Up and Down Look At Data
Gracefully Restart Nginx Web Server After Changes Made In a Config File
interesting that python hides itself in an mp3 file on android
Customize your distribution
The basic layout of a distribution is:AndroidManifest.xml - (*) android manifest (generated from templates)
assets/
private.mp3 - (*) fake package that will contain all the python installation
public.mp3 - (*) fake package that will contain your application
bin/ - contain all the apk generated from build.py
blacklist.txt - list of file patterns to not include in the APK
buildlib/ - internals libraries for build.py
build.py - build script to use for packaging your application
build.xml - (*) build settings (generated from templates)
default.properties - settings generated from your distribute.sh
libs/ - contain all the compiled libraries
local.properties - settings generated from your distribute.sh
private/ - private directory containing all the python files
lib/ this is where you can remove or add python libs.
python2.7/ by default, some modules are already removed (tests, idlelib, ...)
project.properties - settings generated from your distribute.sh
python-install/ - the whole python installation, generated from distribute.sh
not included in the final package.
res/ - (*) android resource (generated from build.py)
src/ - Java bootstrap
templates/ - Templates used by build.py
(*): Theses files are automatically generated from build.py, don't change them directly !
101 Tips to MySQL Tuning and Optimization
MySQL Server Hardware and OS Tuning:
1. Have enough physical memory to load your entire InnoDB file into memory – InnoDB is much faster when the file can be accessed in memory rather than from disk.2. Avoid Swap at all costs – swapping is reading from disk, its slow.
3. Use Battery-Backed RAM.
4. Use an advanced RAID – preferably RAID10 or higher.
5. Avoid RAID5 – the checksum needed to ensure integrity is costly.
6. Separate your OS and data partitions, not just logically, but physically – costly OS writes and reads will impact your database performance.
7. Put your mysql temp space and replication logs on a separate partition than your data – background writes will impact your database when it goes to write/read from disk.
8. More disks equals more speed.
9. Faster disks are better.
10. Use SAS over SATA.
11. Smaller disks are faster than larger disks, especially in RAID configs.
12. Use Battery-Backed Cache RAID controllers.
13. Avoid software raids.
14. Consider using Solid State IO Cards (not disk drives) for your data partition – these cards can sustain over 2GB/s writes for almost any amount of data.
15. On Linux set your swappiness value to 0 – no reason to cache files on a database server, this is more of a web server or desktop advantage.
16. Mount filesystem with noatime and nodirtime if available – no reason to update database file modification times for access.
17. Use XFS filesystem – a faster, smaller filesystem than ext3 and has more options for journaling, also ext3 has been shown to have double buffering issues with MySQL.
18. Tune your XFS filesystem log and buffer variables – for maximum performance benchmark.
19. On Linux systems, use NOOP or DEADLINE IO scheduler – the CFQ and ANTICIPATORY scheduler have been shown to be slow vs NOOP and DEADLINE scheduler.
20. Use a 64-bit OS – more memory addressable and usable to MySQL.
21. Remove unused packages and daemons from servers – less resource stealing.
22. Put your host that use MySQL and your MySQL host in a hosts file – no dns lookups.
23. Never force kill a MySQL process – you will corrupt your database and be running for the backups.
24. Dedicate your server to MySQL – background processes and other services can steal from the db cpu time.
MySQL Configuration:
26. Avoid O_DIRECT and EXT3 filesystem – you will serialize all your writes.
27. Allocate enough innodb_buffer_pool_size to load your entire InnoDB file into memory – less reads from disk.
28. Do not make innodb_log_file_size too big, with faster and more disks – flushing more often is good and lowers the recovery time during crashes.
29. Do not mix innodb_thread_concurrency and thread_concurrency variables – these two values are not compatible.
30. Allocate a minimal amount for max_connections – too many connections can use up your RAM and lock up your MySQL server.
31. Keep thread_cache at a relatively high number, about 16 – to prevent slowness when opening connections.
32. Use skip-name-resolve – to remove dns lookups.
33. Use query cache if your queries are repetitive and your data does not change often – however using query cache on data that changes often will give you a performance hit.
34. Increase temp_table_size – to prevent disk writes.
35. Increase max_heap_table_size – to prevent disk writes.
36. Do not set your sort_buffer_size too high – this is per connection and can use up memory fast.
37. Monitor key_read_requests and key_reads to determine your key_buffer size – the key read requests should be higher than your key_reads, otherwise you are not efficiently using your key_buffer.
38. Set innodb_flush_log_at_trx_commit = 0 will improve performance, but leaving it to default (1), you will ensure data integrity, you will also ensure replication is not lagging
39. Have a test environment where you can test your configs and restart often, without affecting production.
MySQL Schema Optimization:
41. Archive old data – to remove excessive row returns or searches on queries.
42. Put indexes on your data.
43. Do not overuse indexes, compare with your queries.
44. Compress text and blob data types – to save space and reduce number of disk reads.
45. UTF 8 and UTF16 is slower than latin1.
46. Use Triggers sparingly.
47. Keep redundant data to a minimum – do not duplicate data unnecessarily.
48. Use linking tables rather than extending rows.
49. Pay attention to your data types, use the smallest one possible for your real data.
50. Separate blob/text data from other data if other data is often used for queries when blob/text are not.
51. Check and optimize tables often.
52. Rewrite InnoDB tables often to optimize.
53. Sometimes, it is faster to drop indexes when adding columns and then add indexes back.
54. Use different storage engines for different needs.
55. Use ARCHIVE storage engine for Logging tables or Auditing tables – this is much more efficient for writes.
56. Store session data in memcache rather than MySQL – memcache allows for auto-expiring values and prevents you from having to create costly reads and writes to MySQL for temporal data.
57. Use VARCHAR instead CHAR when storing variable length strings – to save space since CHAR is fixed length and VARCHAR is not (utf8 is not affected by this).
58. Make schema changes incrementally – a small change can have drastic effects.
59. Test all schema changes in a development environment that mirrors production.
60. Do NOT arbitrarily change values in your config file, it can have disastrous affects.
61. Sometimes less is more in MySQL configs.
62. When in doubt use a generic MySQL config file.
64. Use EXPLAIN to determine queries are functioning appropriately.
65. Test your queries often to see if they are performing optimally – performance will change over time.
66. Avoid count(*) on entire tables, it can lock the entire table.
67. Make queries uniform so subsequent similar queries will use query cache.
68. Use GROUP BY instead of DISTINCT when appropriate.
69. Use indexed columns in WHERE, GROUP BY, and ORDER BY clauses.
70. Keep indexes simple, do not reuse a column in multiple indexes.
71. Sometimes MySQL chooses the wrong index, use USE INDEX for this case
72. Check for issues using SQL_MODE=STRICT.
73. Use a LIMIT on UNION instead of OR for less than 5 indexed fields.
74. Use INSERT ON DUPLICATE KEY or INSERT IGNORE instead of UPDATE to avoid the SELECT prior to update.
75. Use a indexed field and ORDER BY instead of MAX.
76. Avoid using ORDER BY RAND().
77. LIMIT M,N can actually slow down queries in certain circumstances, use sparingly.
78. Use UNION instead of sub-queries in WHERE clauses.
79. For UPDATES, use SHARE MODE to prevent exclusive locks.
80. On restarts of MySQL, remember to warm your database, to ensure that your data is in memory and queries are fast.
81. Use DROP TABLE then CREATE TABLE instead of DELETE FROM to remove all data from a table.
82. Minimize the data in your query to only the data you need, using * is overkill most of the time.
83. Consider persistent connections instead of multiple connections to reduce overhead.
84. Benchmark queries, including using load on the server, sometimes a simple query can have affects on other queries.
85. When load increases on your server, use SHOW PROCESSLIST to view slow/problematic queries.
86. Test all suspect queries in a development environment where you have mirrored production data.
MySQL Backup Procedures:
88. Stop replication during backups to prevent inconsistencies on data dependencies and foreign constraints.
89. Stop MySQL altogether and take a backup of the database files.
90. Backup binary logs at same time as dumpfile if MySQL dump used – to make sure replication does not break.
91. Do not trust an LVM snapshot for backups – this could create data inconsistencies that will give you issues in the future.
92. Make dumps per table for easier single table recovery – if data is isolated from other tables.
93. Use –opt when using mysqldump.
94. Check and Optimize tables before a backup.
95. When importing temporarily disable foreign constraints for a faster import.
96. When importing temporarily disable unique checks for a faster import.
97. Calculate size of database/tables data and indexes after each backup to monitor growth.
98. Monitor slave replication for errors and delay with a cron script.
99. Perform Backups regularly.
100. Test your backups regularly.
For key MySQL health metrics also look at our white paper: The Monitis Internal MSQL Server Monitoring
Monitis is an all-in-one hosted systems monitoring platform for small and medium-sized businesses. 70,000 sysadmins and IT managers use Monitis platform to monitor their websites, applications and networks. Monitis provides free 15-days trial. (Read More..)
Sabtu, 08 Desember 2012
Trying to combine dropbox and skydrive for redundancy with simbolic link using mklink.
Trying to combine dropbox and skydrive for redundancy with simbolic link using mklink.
(Read More..)Configuring the Social-Engineer Toolkit (SET) to use valid SSL certificates
A JavaScript standard library based on the Ruby core-lib
RubyJS is a JavaScript implementation of all methods from Ruby classes like Array, String, Numbers, Time and more.
Read the announcement post.
http://rubyjs.org/
a!ertifyjs
An unobtrusive customizable JavaScript notification system
http://fabien-d.github.com/alertify.js/
(Read More..)
Kodama
Kodama is a MySQL replication listener based on ruby-binlog.
Kodama provides a simple DSL to easily write your own replication listener.
Features
- Provides simple DSL for writing binlog event handlers
- Automatically restarts from the saved binlog position
- Attempts to reconnect to MySQL when the connection is somehow teminated
https://github.com/y310/kodama (Read More..)
Making your ruby fly
But, there are other tricks which you can use to improve the ruby performance.
Note: you need to recompile ruby if you add one of these “tweaks”
http://alisnic.net/blog/making-your-ruby-fly/
recall slow diff pages on GitHub? ~30s for CSS style recalculation! how they fixed it: http://t.co/IDxB36fC - great presentation.
recall slow diff pages on GitHub? ~30s for CSS style recalculation! how they fixed it: http://t.co/IDxB36fC - great presentation.
(Read More..)PwnPi v2.0 - A Pen Test Drop Box distro for the Raspberry Pi
PwnPi is a Linux-based penetration testing dropbox distribution for the
Raspberry Pi. It currently has 114 network security tools pre-installed
to aid the penetration tester. It is built on the debian squeeze image
from the raspberry pi foundation’s website and uses Xfce as the window
manager
http://toolsyard.thehackernews.com/2012/11/pwnpi-v20-pen-test-drop-box-distro-for.html#_
Understanding Owner Drawing in Delphi
CSS EXPLAIN
Think of it like SQL EXPLAIN
, but for CSS selectors.
https://github.com/josh/css-explain