Skip to content

Instantly share code, notes, and snippets.

View cumanacr's full-sized avatar

Cristian Umaña cumanacr

  • Costa Rica
  • 22:09 (UTC -06:00)
View GitHub Profile
@cumanacr
cumanacr / howto-change-remote-and-track-branch.txt
Last active May 20, 2020 18:35
How to change origin remote on a repository and keep track of master branch in three steps
How to change origin remote on a repository and keep track of master branch in three steps
Example to change it to a GitHub repository
1- Set new url
git remote set-url origin git@github.com:{a-github-user}/{a-repository}.git
2- To check if the new url is set
git remote -v
Displays something like this:
origin git@github.com:{a-github-user}/{a-repository}.git (fetch)
@cumanacr
cumanacr / mysqldump-to-bz2-file.txt
Last active February 24, 2019 04:42
mysqldump to sql.bz2 file
mysqldump --single-transaction --routines -u{user} -p'{password}' {database} | bzip2 -cq9 > {YYYYMMDD}_{HHMM}_{database}.sql.bz2
@cumanacr
cumanacr / kubuntu-Custom-Shortcuts-export.txt
Last active June 22, 2016 08:28
Kubuntu Shortcuts and Gestures - Custom Shortcuts Export
[Data]
DataCount=1
[Data_1]
Comment=Comment
DataCount=10
Enabled=true
Name=qma
SystemGroup=0
Type=ACTION_DATA_GROUP
@cumanacr
cumanacr / ventana-ele.sh
Last active June 17, 2021 18:37
Yakuake - CTRL+L
#!/bin/bash
#funciona pero nunca lo uso
#title="/var/log/syslog"
#command="tail /var/log/syslog -fn500"
#qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession
#terminal=`qdbus org.kde.yakuake /yakuake/sessions terminalIdList | tr , "\n" | sort -g | tail -1 | tr -d '\n'`
#session=`qdbus org.kde.yakuake /yakuake/sessions sessionIdForTerminalId $terminal`
#qdbus org.kde.yakuake /yakuake/tabs org.kde.yakuake.setTabTitle $session "$title"
#qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal $terminal "$command"
@cumanacr
cumanacr / replace-ip-to-localhost-on-mysql-database-backup.txt
Last active June 24, 2016 18:34
Replace ip with localhost on mysql database backup
perl -p -i -e 's/`root`@`{some-ip-number}`/`root`@`localhost`/g' {some-mysql-database-backup}.sql
@cumanacr
cumanacr / pr.txt
Created July 14, 2016 00:04
HowTo create a correct pull request on GitHub
You need to create a fresh branch from the remote HEAD, cherry-pick the commit to that branch, push the branch to your repo on GitHub, then create a pull request.
git checkout -b mybranch
git fetch upstream
git reset --hard upstream/master
git cherry-pick <commit-hash>
git push origin mybranch:mybranch
Further reference on:
http://stackoverflow.com/questions/25955822/git-cherry-pick-a-single-commit-for-pull-request
@cumanacr
cumanacr / mysql-dump.txt
Last active November 14, 2018 22:38
MySQL dump command
# mysql dump
mysqldump --single-transaction --routines -uroot -p dbname | bzip2 -cq9 > dbname.sql.bz2
@cumanacr
cumanacr / genesis_public_key
Created February 21, 2018 18:06
genesis_public_key
04c6bf737fdc6d5718770fac0a24b0f3584a2db3e0708c253619eae53c0468195bc383ca9ba30d6e831decdf3931a02e9c7d6f5c4df2dff45583ddea0649262257;mrbarletta
@cumanacr
cumanacr / NotoColorEmoji.css
Last active October 9, 2018 01:24
NotoColorEmoji.css
/*
Download the font from this url:
https://noto-website-2.storage.googleapis.com/pkgs/NotoColorEmoji-unhinted.zip
*/
@font-face {
font-family: 'NotoColorEmoji';
font-style: normal;
font-weight: 400;
src: local('Noto Color Emoji'), local('NotoColorEmoji'),
url('fonts/Noto/NotoColorEmoji.ttf') format('truetype')
Check this out:
http://www.ibridge.be/?p=194