Skip to content

Instantly share code, notes, and snippets.

View iamtekeste's full-sized avatar
🕺
having fun with code

Tekeste Gebreanenia iamtekeste

🕺
having fun with code
View GitHub Profile
#!/bin/bash
# USAGE: Will create a .tar.gz with CSVs of all tables in schema.
# Configure below and run as root (i.e. the user mysql runs as)
#
# The script will (or should) SELECT * INTO OUTFILE your tables
# and save them into csv files under /tmp dir first, then name them
# like the tables and move them thogether into a directory. Then
# it will tar everything together and chown you the tarball.
# Schema to export:
@iamtekeste
iamtekeste / Mysql command
Created January 22, 2014 19:11
MySql Related Commands
backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql
@iamtekeste
iamtekeste / Ruby installation
Created January 22, 2014 20:08
Ruby Installation!!!
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
@iamtekeste
iamtekeste / Copy Single file to multiple directories
Last active August 29, 2015 13:56
Copy Single file to multiple directories
#Linux
echo dir1 dir2 dir3 | xargs -n 1 cp file1
#Windows
for /d %F in (e:\*) do @if /i "%F" neq "e:\wav" 2>nul xcopy "%F\*.wav" "e:\wav"

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@iamtekeste
iamtekeste / Ruby Shell Commands
Created February 20, 2014 14:26
Run Shell Commands with Ruby!
#Exec
$ irb
>> exec 'echo "hello $HOSTNAME"'
hello nate.local
$
#System
$ irb
>> system 'echo "hello $HOSTNAME"'
@iamtekeste
iamtekeste / remote desktop
Created February 25, 2014 07:49
Connect to Remote Desktop from terminal ubuntu
rdesktop -u username -g 1024×768 servername
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@iamtekeste
iamtekeste / ruby manual installation
Created March 19, 2014 12:36
Ruby Requirements Manual Installation
Try running sudo apt-get update separately on a command line. Your Ubuntu might be old and its repositories could be out of date. So apt-get update itself is maybe not working in your machine.
To step over that issue, run the following commands:
# Disable RVM from trying to install necessary software via apt-get
rvm autolibs disable
# Then try installing Ruby:
rvm install 1.8.7
@iamtekeste
iamtekeste / current page url
Created March 21, 2014 13:47
Get Current Page URL ~ Laravel
You can use: Request::url() to obtain the current URL, here is an example:
@if(Request::url() === 'your url here')
// code
@endif
Laravel offers a method to find out, whether the URL matches a pattern or not
if (Request::is('admin/*'))
{
// code