This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: 1- LED BLINKING | |
int pinLed = 13; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(pinLed, OUTPUT); // NOTE: specifying pin (13) as output | |
digitalWrite(pinLed, HIGH); // NOTE: sends 5v to pin (13) | |
digitalWrite(pinLed, LOW); // NOTE: sends 0v to pin (13) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1- (server) create a git repository on server side | |
git init --bare ~/<projec-name> | |
# 2- (server) into the directory: '~/<project-name>/hooks/' create a file: 'post-receive' and add this: | |
!/bin/bash | |
while read oldrev newrev ref | |
do | |
if [[ $ref =~ .*/master$ ]]; | |
then | |
echo "== GIT HOOKS : Master ref received. Deploying master branch to production... ==" | |
git --work-tree=~/<dir-name>/<dir-name>/ checkout -f master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hook | |
import "fmt" | |
// model struct | |
type ItemType struct { | |
// define props | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "== CREATE DOCKER MICROSERVICES INFRAESTRUCTURE ==" | |
echo "==== creating hub network ===="; | |
sudo docker network create autocom-services-hub-network --subnet=172.1.1.0/24 | |
sleep 5; | |
wait | |
echo "==== creating reverse proxy ===="; | |
sudo docker run --name ms-nginx-reverse-proxy-server -d --ip 172.1.1.2 --net autocom-services-hub-network -p 80:80 -v /home/lalo/Docker/AutocomServices/ms-nginx-reverse-proxy-server:/shared --hostname ms-nginx-reverse-proxy-server -i centos:7 | |
sleep 5; | |
wait | |
echo "==== creating api gateway ===="; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python | |
$sudo yum install centos-release-scl | |
$sudo yum install rh-python36 | |
$scl enable rh-python36 bash | |
$python --version | |
$pip | |
# NodeJS - NVM | |
$curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash | |
$nvm --version # list all versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd path/to/project-b | |
git remote add project-a path/to/project-a | |
git fetch project-a | |
git merge --allow-unrelated-histories project-a/master --squash # or whichever branch you want to merge | |
git remote remove project-a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bash_profile | |
[[ -s ~/.bashrc ]] && source ~/.bashrc | |
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
function prompt { | |
local BLACK="\[\033[0;30m\]" | |
local BLACKBOLD="\[\033[1;30m\]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function express_remove_route(router_path,callback) { | |
express_stack = router.stack; | |
console.log("================= express_remove_route =================="); | |
express_stack.forEach(function(route_layer){ | |
if( !route_layer ) return; | |
if( route_layer.route.path.indexOf(router_path) >= 1 ) { | |
//console.log(router_path,route_layer.route.path.indexOf(router_path)); // log layer | |
idx = express_stack.indexOf(route_layer); | |
//console.log("IDX",idx); // id to remove layer | |
express_stack.splice(idx, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy some file from android device system with adb. It will be hide | |
adb shell run-as com.g4a.quadratin cp /data/data/com.g4a.quadratin/databases/quadratin_app.db /sdcard/DB |
NewerOlder