Skip to content

Instantly share code, notes, and snippets.

View devcfgc's full-sized avatar
:octocat:
planning

Carlos Gomez devcfgc

:octocat:
planning
View GitHub Profile
@devcfgc
devcfgc / golang.txt
Created January 3, 2017 14:30
golang commands
$ sudo yum -y install golang git bind-utils
$ mkdir ~/go
$ export GOPATH=$HOME/go
$ export PATH=$PATH:$GOPATH/bin
@devcfgc
devcfgc / terraform.sh
Last active March 29, 2017 05:00
terraform commands
$ terraform plan # plan
$ terraform apply # shortcut for plan & apply - avoid this in production
$ terraform plan -out changes.terraform # terraform plan and write the plan to out file
$ terraform apply changes.terraform # apply terraform plan using out file
$ terraform show # show current state
$ cat terraform.tfstate # show state in JSON format
@devcfgc
devcfgc / generate_azure_spect_code.sh
Last active February 6, 2017 10:38
azure swagger to code
#https://github.com/Azure/autorest
#https://github.com/Azure/azure-rest-api-specs
mono AutoRest.exe -Namespace apimanagement -Input path_to_json.json -CodeGenerator Go -Modeler Swagger
@devcfgc
devcfgc / docker.md
Last active March 10, 2024 17:14
docker commands

DOCKER

After installing

sudo usermod -aG docker $USER`                                     # add your user to the docker group
docker run -it <IMAGE:TAG> /bin/bash                               # run container in interactive mode and open a bash shell
docker run -d <IMAGE:TAG>                                          # run container in detach mode

Commands

@devcfgc
devcfgc / packer.md
Last active May 4, 2017 08:33
packer installation

ubuntu

  1. download packer
  2. unzip at ~/packer
  3. add to PATH
    • sudo vim ~/.profile export PATH=$PATH:~/packer/
    • sudo vim ~/.bashrc export PATH=$PATH:~/packer/
    • Make Packer to be available throughout the system sudo cp -r ~/packer/* /usr/bin/
@devcfgc
devcfgc / git_commands.md
Last active January 24, 2019 13:24
git most used commands

create branch from remote branch

  • git checkout -b branch-name origin/branch-name

remote

  • git remote add origin https://github.com/username/reponame.git
  • git remote -v
  • git branch --remote # to see all the branches from remote
  • git checkout branch-name # checkout a branch from remote
  • git remote rm destination # delete remote
  • git remote rename origin destination # change remote name from 'origin' to 'destination'
@devcfgc
devcfgc / SLQclient.txt
Created April 15, 2016 13:48
SLQ client user preferences
# Go to Tools / Options / Environment / Fonts and Colors.
(Plain Text)
Item foreground -> RGB(228,228,228)
Item background -> RGB(50,50,50)
Comment -> RGB(255,175,45)
Keyword -> RGB(127,176,228)
Script Comment -> RGB(255,175,45)
Script keyword -> RGB(0,255,255)
Script string -> RGB(255,255,0)
@devcfgc
devcfgc / puppet_tips.rb
Last active December 20, 2016 09:58
Puppet tips
#Avoid duplicate declaration https://docs.puppet.com/puppet/latest/reference/lang_collectors.html
File <| title == 'folder_name' |> {
ensure => directory
}
#Symbolic links
file { '/etc/apache2/sites-enabled/001-puppet-lore.org':
ensure => 'link',
target => '../sites-available/puppet-lore.org',
}
@devcfgc
devcfgc / android_home_mac.txt
Created February 27, 2016 09:31
Setting ANDROID_HOME enviromental variable on Mac OS X
In Terminal:
nano ~/.bash_profile
Add lines:
export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
Check it worked:
source ~/.bash_profile
@devcfgc
devcfgc / userlogin.sql
Last active December 23, 2015 15:12
Script SQL Server to bind user's database with login -- To execute EXEC sp_help_revlogin
USE master
GO
IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL
DROP PROCEDURE sp_hexadecimal
GO
CREATE PROCEDURE sp_hexadecimal
@binvalue varbinary(256),
@hexvalue varchar (514) OUTPUT
AS
DECLARE @charvalue varchar (514)