Skip to content

Instantly share code, notes, and snippets.

Avatar

Marko Martinović Marko-M

View GitHub Profile
@Marko-M
Marko-M / wpa_wlan.sh
Last active Dec 21, 2015
Debian based wireless with WPA/WPA2 from CLI
View wpa_wlan.sh
#!/bin/bash
# One time only, to create wpa.conf:
# wpa_passphrase ESSID secret > wpa.conf
# su to root, or use sudo for following commands
su
# Bring the wlan interface up
ifconfig wlan0 up
@Marko-M
Marko-M / magento_dump_ssh.sh
Last active Feb 8, 2016
One-liner dump Magento database trough SSH directly to your machine
View magento_dump_ssh.sh
#!/bin/bash
# Marko Martinović
# Print command traces
set -x
# SSH user
SSHUSER=""
# SSH host
@Marko-M
Marko-M / git_amend_change_author.sh
Created Sep 7, 2013
Git - Amend previous commit to change author
View git_amend_change_author.sh
#!/bin/bash
git commit --amend --author="You <you@example.com>"
@Marko-M
Marko-M / magento-dump-import-ssh.sh
Last active Nov 22, 2017
Almost one-liner dump and import of Magento database trough SSH (with ignore tables and triggers definer adjustment)
View magento-dump-import-ssh.sh
#!/bin/bash
# Marko Martinović
# Prints command traces
set -x
# Tables to ignore
IGNORE_TABLES=(dataflow_batch_export dataflow_batch_import log_customer log_quote log_summary log_summary_type log_url log_url_info log_visitor log_visitor_info log_visitor_online report_event index_event enterprise_logging_event_changes core_cache core_cache_tag core_session core_cache_tag)
# Source SSH
View magento-transfer-1.sh
#!/bin/bash
# magento-transfer-1.sh
# Marko Martinovic
#
# Initiate on a new web server
# Maintenance mode not required
# Prints command traces
set -x
View magento-transfer-2.sh
#!/bin/bash
# magento-transfer-2.sh
# Marko Martinovic
#
# Initiate on a destination web server
# Maintenance mode required
# Prints command traces
set -x
@Marko-M
Marko-M / gist:9588211
Last active Sep 12, 2018
Xdebug trace with ?XDEBUG_TRACE trigger
View gist:9588211
zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.auto_trace=0
xdebug.trace_enable_trigger=1
xdebug.trace_format=0
xdebug.trace_output_name=trace.%R
xdebug.collect_params=1
@Marko-M
Marko-M / gist:8056f4ef04d9f70025fe
Last active Aug 29, 2015
Stored procedure - truncate all tables [MySQL]
View gist:8056f4ef04d9f70025fe
DELIMITER //
CREATE PROCEDURE truncateAllTables()
--
-- truncateAllTables
-- Date: 2014-05-26
-- Author: Andrew Cassidy <andrew@cassidywebservices.co.uk>
-- Author: Marko Martinović <marko@techytalk.info>
--
-- This Stored Procedure loops over the tables in the current database and
-- truncates them.
@Marko-M
Marko-M / gist:10931ff5e990431b5410
Last active Aug 14, 2018
Stored procedure - drop all tables [MySQL]
View gist:10931ff5e990431b5410
DELIMITER //
CREATE PROCEDURE dropAllTables()
--
-- dropAllTables
-- Date: 2014-05-26
-- Author: Andrew Cassidy <andrew@cassidywebservices.co.uk>
-- Author: Marko Martinović <marko@techytalk.info>
--
-- This Stored Procedure loops over the tables in the current database and
-- drops them.
@Marko-M
Marko-M / quick-chat.php
Created Jul 18, 2014
Display Quick Chat programmatically
View quick-chat.php
<php
if(class_exists('Quick_Chat')) {
global $quick_chat;
*/
* Define option variables:
*
* $height = '400';
* $room = 'default';