Skip to content

Instantly share code, notes, and snippets.

View mkdizajn's full-sized avatar
🐢
slow & thorough > faster & mistakable

Kresimir Pendic mkdizajn

🐢
slow & thorough > faster & mistakable
View GitHub Profile
@mkdizajn
mkdizajn / MYSQL RESET AND RECOVER ROOT USER AND PASSWORD
Last active December 19, 2015 02:29
MYSQL RESET AND RECOVER ROOT USER AND PASSWORD!!!! last resort create the root user if missing!!
MYSQL RESET AND RECOVER ROOT USER AND PASSWORD!!!!
Stop the mysql demon process using this command :
sudo /etc/init.d/mysql stop
Start the mysqld demon process using the --skip-grant-tables option with this command
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
Because you are not checking user privs at this point, it's safest to disable networking. In Dapper, /usr/bin/mysgld... did not work. However, mysqld --skip-grant-tables did.
start the mysql client process using this command
mysql -u root
@mkdizajn
mkdizajn / google chrome jquery edit page or links
Last active December 19, 2015 06:09
google chrome jquery edit page or links
@mkdizajn
mkdizajn / magento layout product_list_toolbar direction for pager
Last active December 19, 2015 12:49
magento layout product_list_toolbar direction for pager
<reference name="product_list_toolbar">
<action method="setDefaultDirection" before="product_list_toolbar_pager"><dir>desc</dir></action>
</reference>
# Magento Snippets #
## Download extension manually using pear/mage ##
Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/
./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent
## Clear cache/reindex ##
@mkdizajn
mkdizajn / magento aw blog recent posts widget to display short content.php
Last active April 24, 2017 10:56
magento aw blog recent posts widget to display short content
<?php
/**
* aheadWorks Co.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://ecommerce.aheadworks.com/AW-LICENSE.txt
@mkdizajn
mkdizajn / mssql server backup script
Last active December 20, 2015 01:09
mssql server backup script
net stop w3svc
sqlcmd -S .\sqlexpress -E -Q "alter database fb1 set offline"
sqlcmd -S .\sqlexpress -E -Q "alter database fb2 set offline"
sqlcmd -S .\sqlexpress -E -Q "alter database fb3 set offline"
sqlcmd -S .\sqlexpress -E -Q "alter database fb4 set offline"
sqlcmd -S .\sqlexpress -E -Q "alter database fb5 set offline"
sqlcmd -S .\sqlexpress -E -Q "alter database fb6 set offline"
For /F "Tokens=2" %%I in ('Date /T') Do Set datum=%%I
@mkdizajn
mkdizajn / Display sql server columns from more tables with 'union all'
Last active December 20, 2015 01:09
Display sql server columns from more tables with 'union all'
(select COUNT(*) from temp.dbo.[tbl1]) union all
(select COUNT(*) from temp.dbo.[tbl2]) union all
(select COUNT(*) from temp.dbo.[tbl3]) union all
(select COUNT(*) from temp.dbo.[tbl4])
@mkdizajn
mkdizajn / magento misc infortis theme snippets for frontend
Last active December 20, 2015 03:49
magento misc infortis theme snippets for frontend
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<!-- BANNER STYLE -::- TEXT OVER PICTURE -->
@mkdizajn
mkdizajn / ubuntu run apache server as a local user
Last active December 20, 2015 05:29
ubuntu run apache server as a local user
run apache as a local user
sudo nano /etc/apache2/envvars
export APACHE_RUN_USER=kreso
export APACHE_RUN_GROUP=kreso
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_