PHP string to time not working - Error/Problem

Replace the - to /


Google Chrome can not be run as root - BackTrack 5

Google Chrome can not be run as root.
Please start Google Chrome as a normal user. To run as root, you must specify an alternate --user-data-dir for storage of profile information.

1. Open Konsole Terminal

2. Type

  cd /opt/google/chrome/
  hexedit chrome

3. Press Tab -> Switch to ASCII

4. Press Ctrl+ S -> Search "geteuid"

  Modify to "getppid"

5. Press Ctrl+ X -> Save



Install Flash Player - BackTrack 5

  • As you may have noticed Flash Player does not work on Backtrack 5, so in order to fix this we first need to remove the current flash player by issuing the following commands:
root@bt:~# apt-get purge flashplugin-nonfree flashplugin-installer gnash gnash-common mozilla-plugin-gnash swfdec-mozilla
root@bt:~# rm -f /usr/lib/firefox/plugins/*flash*
root@bt:~# rm -f /usr/lib/firefox-addons/plugins/*flash*
root@bt:~# rm -f /usr/lib/mozilla/plugins/*flash*
root@bt:~# rm -f ~/.mozilla/plugins/*flash*so
root@bt:~# rm -rfd /usr/lib/nspluginwrapper
  • After removing flash we need to get the new flash player from the official website:
  1. Flash x64 ONLY FOR x64.
  2. Flash Player Download the .tar.gz file.
  • We will begin with Flash Square, SKIP THIS if you aren't using an x64 version of BackTrack.
root@bt:~# tar xvfz flashplayer10_2_p3_64bit_linux_111710.tar.gz
root@bt:~# chown root:root libflashplayer.so
root@bt:~# chmod 644 libflashplayer.so
root@bt:~# cp -f libflashplayer.so /usr/lib/mozilla/plugins/
root@bt:~# rm -rf libflashplayer.so
root@bt:~# ln -s /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/firefox/plugins/
  • Next up we will take care of the Flash Player:
root@bt:~# tar xvfz install_flash_player_10_linux.tar.gz
root@bt:~# mkdir ~/.mozilla/plugins
root@bt:~# mv -f libflashplayer.so ~/.mozilla/plugins/
root@bt:~# ln -s /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/firefox-addons/plugins/
root@bt:~# ln -s /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/xulrunner-addons/plugins/


  • We can test if flash player works over here.

Extract tar gz files (.tar.gz) - Linux command

Extract the vtigercrm-5.4.0.tar.gz archive file to /var/www/
tar xvfz vtigercrm-5.4.0.tar.gz -C /var/www/

More:
man tar

Top 1000 SQL Performance Tips - Top10SQLPerformanceTips

Interactive session from MySQL Camp I:
Specific Query Performance Tips (see also database design tips for tips on indexes):
  1. Use EXPLAIN to profile the query execution plan
  2. Use Slow Query Log (always have it on!)
  3. Don't use DISTINCT when you have or could use GROUP BY
  4. Insert performance
    1. Batch INSERT and REPLACE
    2. Use LOAD DATA instead of INSERT
  5. LIMIT m,n may not be as fast as it sounds. Learn how to improve it and read more about Efficient Pagination Using MySQL
  6. Don't use ORDER BY RAND() if you have > ~2K records
  7. Use SQL_NO_CACHE when you are SELECTing frequently updated data or large sets of data
  8. Avoid wildcards at the start of LIKE queries
  9. Avoid correlated subqueries and in select and where clause (try to avoid in)
  10. No calculated comparisons -- isolate indexed columns
  11. ORDER BY and LIMIT work best with equalities and covered indexes
  12. Separate text/blobs from metadata, don't put text/blobs in results if you don't need them
  13. Derived tables (subqueries in the FROM clause) can be useful for retrieving BLOBs without sorting them. (Self-join can speed up a query if 1st part finds the IDs and uses then to fetch the rest)
  14. ALTER TABLE...ORDER BY can take data sorted chronologically and re-order it by a different field -- this can make queries on that field run faster (maybe this goes in indexing?)
  15. Know when to split a complex query and join smaller ones
  16. Delete small amounts at a time if you can
  17. Make similar queries consistent so cache is used
  18. Have good SQL query standards
  19. Don't use deprecated features
  20. Turning OR on multiple index fields (<5.0) into UNION may speed things up (with LIMIT), after 5.0 the index_merge should pick stuff up.
  21. Don't use COUNT * on Innodb tables for every search, do it a few times and/or summary tables, or if you need it for the total # of rows, use SQL_CALC_FOUND_ROWS and SELECT FOUND_ROWS()
  22. Use INSERT ... ON DUPLICATE KEY update (INSERT IGNORE) to avoid having to SELECT
  23. use groupwise maximum instead of subqueries
  24. Avoid using IN(...) when selecting on indexed fields, It will kill the performance of SELECT query.
  25. Prefer using UNION ALL if you don't need to merge the result
Scaling Performance Tips:
  1. Use benchmarking
  2. isolate workloads don't let administrative work interfere with customer performance. (ie backups)
  3. Debugging sucks, testing rocks!
  4. As your data grows, indexing may change (cardinality and selectivity change). Structuring may want to change. Make your schema as modular as your code. Make your code able to scale. Plan and embrace change, and get developers to do the same.
Network Performance Tips:
  1. Minimize traffic by fetching only what you need.
    1. Paging/chunked data retrieval to limit
    2. Don't use SELECT *
    3. Be wary of lots of small quick queries if a longer query can be more efficient
  2. Use multi_query if appropriate to reduce round-trips
  3. Use stored procedures to avoid bandwidth wastage
OS Performance Tips:
  1. Use proper data partitions
    1. For Cluster. Start thinking about Cluster *before* you need them
  2. Keep the database host as clean as possible. Do you really need a windowing system on that server?
  3. Utilize the strengths of the OS
  4. pare down cron scripts
  5. create a test environment
  6. source control schema and config files
  7. for LVM innodb backups, restore to a different instance of MySQL so Innodb can roll forward
  8. partition appropriately
  9. partition your database when you have real data -- do not assume you know your dataset until you have real data
  10. Reduce swappiness of your OS
MySQL Server Overall Tips:
  1. innodb_flush_commit=0 can help slave lag
  2. Optimize for data types, use consistent data types. Use PROCEDURE ANALYSE() to help determine the smallest data type for your needs.
  3. use optimistic locking, not pessimistic locking. try to use shared lock, not exclusive lock. share mode vs. FOR UPDATE
  4. if you can, compress text/blobs
  5. compress static data
  6. don't back up static data as often
  7. enable and increase the query and buffer caches if appropriate
  8. config params -- http://docs.cellblue.nl/2007/03/17/easy-mysql-performance-tweaks/ is a good reference
  9. Config variables & tips:
    1. use one of the supplied config files
    2. key_buffer, unix cache (leave some RAM free), per-connection variables, innodb memory variables
    3. be aware of global vs. per-connection variables
    4. check SHOW STATUS and SHOW VARIABLES (GLOBAL|SESSION in 5.0 and up)
    5. be aware of swapping esp. with Linux, "swappiness" (bypass OS filecache for innodb data files, innodb_flush_method=O_DIRECT if possible (this is also OS specific))
    6. defragment tables, rebuild indexes, do table maintenance
    7. If you use innodb_flush_txn_commit=1, use a battery-backed hardware cache write controller
    8. more RAM is good so faster disk speed
    9. use 64-bit architectures
  10. --skip-name-resolve
  11. increase myisam_sort_buffer_size to optimize large inserts (this is a per-connection variable)
  12. look up memory tuning parameter for on-insert caching
  13. increase temp table size in a data warehousing environment (default is 32Mb) so it doesn't write to disk (also constrained by max_heap_table_size, default 16Mb)
  14. Run in SQL_MODE=STRICT to help identify warnings
  15. /tmp dir on battery-backed write cache
  16. consider battery-backed RAM for innodb logfiles
  17. use --safe-updates for client
  18. Redundant data is redundant
  19. Keep an eye on buffer pool and keybuffer hit rate
Storage Engine Performance Tips:
  1. InnoDB ALWAYS keeps the primary key as part of each index, so do not make the primary key very large
  2. Utilize different storage engines on master/slave ie, if you need fulltext indexing on a table.
  3. BLACKHOLE engine and replication is much faster than FEDERATED tables for things like logs.
  4. Know your storage engines and what performs best for your needs, know that different ones exist.
    1. ie, use MERGE tables ARCHIVE tables for logs
    2. Archive old data -- don't be a pack-rat! 2 common engines for this are ARCHIVE tables and MERGE tables
  5. use row-level instead of table-level locking for OLTP workloads
  6. try out a few schemas and storage engines in your test environment before picking one.
Database Design Performance Tips:
  1. Design sane query schemas. don't be afraid of table joins, often they are faster than denormalization
  2. Don't use boolean flags
  3. Use Indexes
  4. Don't Index Everything
  5. Do not duplicate indexes
  6. Do not use large columns in indexes if the ratio of SELECTs:INSERTs is low.
  7. Split out large blob elements in InnoDB
  8. be careful of redundant columns in an index or across indexes
  9. Use a clever key and ORDER BY instead of MAX
  10. Normalize first, and denormalize where appropriate.
  11. Databases are not spreadsheets, even though Access really really looks like one. Then again, Access isn't a real database
  12. use INET_ATON and INET_NTOA for IP addresses, not char or varchar
  13. make it a habit to REVERSE() email addresses, so you can easily search domains (this will help avoid wildcards at the start of LIKE queries if you want to find everyone whose e-mail is in a certain domain)
  14. A NULL data type can take more room to store than NOT NULL
  15. Avoid NULL in index attributes. Use 0 instead
  16. Storing flags in a database can slow down execution due to a bad cardinality. Try using bit flags
  17. Don't store flags in a NULL and NOT NULL manner. Update from NULL -> 1 is slower than 0 -> 1
  18. Choose appropriate character sets & collations -- UTF16 will store each character in 2 bytes, whether it needs it or not, latin1 is faster than UTF8.
  19. Use Triggers wisely
  20. Use delayed key wrote
  21. use min_rows and max_rows to specify approximate data size so space can be pre-allocated and reference points can be calculated.
  22. Use HASH indexing for indexing across columns with similar data prefixes
  23. Use myisam_pack_keys for int data
  24. be able to change your schema without ruining functionality of your code
  25. segregate tables/databases that benefit from different configuration variables
  26. Don't access the last key part in a where clause with =
  27. Abuse the system for optimiization you're using with system dependant features like RTREE's for optimized range queries
Other:
  1. Hire a MySQL (tm) Certified DBA
  2. Know that there are many consulting companies out there that can help, as well as MySQL's Professional Services.
  3. Read and post to MySQL Planet at http://www.planetmysql.org
  4. Attend the yearly MySQL Conference and Expo or other conferences with MySQL tracks (link to the conference here)
  5. Support your local User Group (link to forge page w/user groups here)

Authored by

Jay Pipes, Sheeri Kritzer, Bill Karwin, Ronald Bradford, Farhan "Frank Mash" Mashraqi, Taso Du Val, Ron Hu, Klinton Lee, Rick James, Alan Kasindorf, Eric Bergen, Robert Eisele, Kaj Arno, Joel Seligstein, Amy Lee, Sameer Joshi, Surat Singh Bhati

Where does Konqueror store its history, and how do I erase it?

There are several kinds of "history" stored by Konqueror.
  • The location bar combobox items and completion: you can clear those with right-click, "Clear History".
  • The history module in the sidebar: you can clear it with a right-click on one of the host names, and selecting "Clear History".
  • The HTTP cache (known as "Temporary Internet Files" in other environments) can be cleared in the KControl module called "Cache", using the "Clear cache" button on the bottom right.
 File locations (~/.kde is only an indication. Your distributor, or $KDEHOME, could have modified that value) :
  • Combobox items: ~/.kde/share/config/konq_history
  • History module and combobox completion: ~/.kde/share/apps/konqueror/konq_history (binary file)
  • HTTP cache: ~/.kde/share/cache/http/ (previously in ~/.kde/share/apps/kio_http/cache/)

JavaScript - Print Objects


JavaScript (sometimes abbreviated as JS) is a scripting language commonly implemented as part of a web browser in order to create enhanced user interfaces and dynamic websites.

JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It uses syntax influenced by the language C. JavaScript copies many names and naming conventions from Java, but the two languages are otherwise unrelated and have very different semantics. The key design principles within JavaScript are taken from the Self and Scheme programming languages. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles.

JavaScript's use in applications outside web pages — for example in PDF documents, site-specific browsers, and desktop widgets—is also significant. Newer and faster JavaScript VMs and frameworks built upon them (notably Node.js) have also increased the popularity of JavaScript for server-side web applications.

JavaScript was formalized in the ECMAScript language standard and is primarily used in the form of client-side JavaScript (as part of a web browser). This enables programmatic access to computational objects within a host environment.


// object
var userObj= {
    username: 'username',
    password: 'password'
}

// print
alert(userObj.toSource());

// or
for(attr in userObj){
    alert(attr+ '= '+ userObj[attr]);
}

console.log(userObj);




Backtrack 5 - Ubuntu Software Center

Lets you choose from thousands of free applications available for Ubuntu.

Install
apt-get install software-center

Backtrack 5 - Ubuntu Software Center

Video


With Ubuntu Software Centre, you can pick the apps you want so you won’t have anything on your computer you don’t need. And with thousands of apps to choose from, you’ll be spoilt for choice.

Each application comes with ratings and reviews to make it easier for you to decide which apps you want to install.

Backtrack 5 - Video Recorder | Video Capturer

  1. gtk-recordMyDesktop - graphical gtk frontend for recordMyDestkop
  2. recordmydesktop  - record desktop sessions to an Ogg-Theora-Vorbis file.
Install
  1. apt-get install gtk-recordMyDesktop
  2. apt-get install recordmydesktop
Run
  1. gtk-recordMyDesktop
  2. recordmydesktop

Backtrack 5 - Video Recorder | Video Capturer
 
recordMyDesktop is a free and open source desktop screencasting software application written for GNU/Linux. The program is separated into two parts; a command line tool that performs the tasks of capturing and encoding, and an interface that exposes the program functionality graphically. There are two front-ends written in python with pyGtk (gtk-recordMyDesktop) and pyQt4 (qt-recordMyDesktop). RecordMyDesktop also offers the ability to record audio through ALSA, OSS or the JACK audio server. RecordMyDesktop only outputs to Ogg using Theora for video and Vorbis for audio.

BackTrack 5 - Print Screen

import - saves any visible window on an X server and outputs it as an image file. You can capture a single window, the entire screen, or any rectangular portion of the screen.

The import program is a member of the ImageMagick(1) suite of tools.  Use it to capture some or all of an X server screen and save the image to a file.

       For more information about the import command, point your browser to file:///usr/share/doc/imagemagick/www/import.html or http://www.imagemagick.org/script/import.php.


Konsole Terminal

Konsole Terminal

import test.png

import test.png

import --help


Copyright  (C)  1999-2009  ImageMagick  Studio  LLC.  Additional  copyrights  and  licenses  apply  to  this  software,  see  file:///usr/share/doc/imagemagick/www/license.html  or
       http://www.imagemagick.org/script/license.php