Skip to content

Instantly share code, notes, and snippets.

View RobbiNespu's full-sized avatar
:octocat:
Wut?

Robbi Nespu RobbiNespu

:octocat:
Wut?
View GitHub Profile
@RobbiNespu
RobbiNespu / use_wnameless_oracle-xe-11g.md
Created April 8, 2017 03:16 — forked from ochinchina/use_wnameless_oracle-xe-11g.md
how to use wnameless/oracle-xe-11g docker image

##pull wnameless/oracle-xe-11g

$ sudo docker pull wnameless/oracle-xe-11g

##start the wnameless/oracle-xe-11g

$ sudo docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g
@RobbiNespu
RobbiNespu / git-cheat-sheet.md
Created April 3, 2017 16:43
Git Cheat Sheet

Git Cheat Sheet

Although there are enough resources on the web about Git, I will keep this one for my own reference. Minimal Git version required 1.7.2.

TOC

#!/bin/bash
# Destination: ~/.pomodoro/hooks/work.d/
# Goal: block access to Twitter and Facebook while in a Pomodoro
# Note: won't work if you use Chrome, as it maintains an internal (not flushable from CLI) DNS cache. Fuck it.
# This file must be able to touch "/etc/hosts":
# The best way would be to create a group able to modify the "/etc/hosts" file:
# $ sudo addgroup host-manager
# $ sudo chgrp host-manager /etc/hosts
@RobbiNespu
RobbiNespu / backup-to-git.sh
Created January 3, 2017 06:38 — forked from Amitesh/backup-to-git.sh
DB Backup to Git
#!/bin/bash
##
# MySQL DB dump to Git commit
#
# Dumps the specified mysql database to the given location and commits it and
# the previous database to the Git repository.
#
# It is assumed you have already setup the Git respository to only be the
# a checkout of the database backup location
<?php
function getService()
{
// Creates and returns the Analytics service object.
// Load the Google API PHP Client Library.
require_once 'google-api-php-client/src/Google/autoload.php';
// Create and configure a new client object.
@RobbiNespu
RobbiNespu / query_finder.sql
Created November 28, 2016 17:35 — forked from mezis/query_finder.sql
Finding long-running queries in MySQL
SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120)
FROM information_schema.processlist
WHERE command <> 'Sleep'
AND info NOT LIKE '%PROCESSLIST%'
ORDER BY time DESC LIMIT 50;
##########
# +----+ #
# | DS | #
# +----+ #
##########
# set vi mode
set -o vi
# set colors correctly on OS X
@RobbiNespu
RobbiNespu / Git_shared_hosting.sh
Created November 18, 2015 22:35 — forked from theodorosploumis/Git_shared_hosting.sh
Install Git on Shared hosting (Tested with Freebsd)
#!/bin/bash -e
# IMPORTANT. You must have gcc and wget installed
echo -n "Please enter the Git branch (eg 2.6.2): "
read branch
echo -n "Perl path (run 'which perl' to find the path): "
read perl_path
# Add bin in PATH
@RobbiNespu
RobbiNespu / dbconversion.php
Last active September 19, 2015 14:45 — forked from sanjaybhowmick/dbconversion.php
Convert MySQL collation from utf8mb4 to utf8
<?php
$dbname = 'your-database-name';
mysql_connect('your-database-hostname', 'your-database-username', 'your-database-password');
mysql_query("ALTER DATABASE `$dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
$result = mysql_query("SHOW TABLES FROM `$dbname`");
while($row = mysql_fetch_row($result)) {
$query = "ALTER TABLE {$dbname}.`{$row[0]}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
mysql_query($query);
$query = "ALTER TABLE {$dbname}.`{$row[0]}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci";
mysql_query($query);