Skip to content

Instantly share code, notes, and snippets.

@caiogallo
caiogallo / xbox-controller.py
Created April 22, 2021 02:23
xbox one bluethooth controller on raspberry pi 4
# python3
# apt install python-pip
# apt install python3-evdev
# pip install evdev
#
# list devices
# ls /dev/input/
#
# https://diyprojects.io/python-library-evdev-raspberry-pi-use-gamepad-diy-projects-servomotor-games/#.Xa8ZR-gzaUl
@caiogallo
caiogallo / gist:2b4ed2d7b6584d278f9a44e2452d3d6d
Last active March 5, 2020 10:35
Oracle VirtualBox Commands
# list nat networks
VBoxManage list natnets
# remove nat network
VBoxManage natnetworks remove --netname <network-name>
@caiogallo
caiogallo / create-redis-cluster.sh
Created April 2, 2019 19:36 — forked from abhirockzz/create-redis-cluster.sh
Use redis-cli to create a Redis Cluster on Docker (with Redis 5.0)
#------------ bootstrap the cluster nodes --------------------
start_cmd='redis-server --port 6379 --cluster-enabled yes --cluster-config-file nodes.conf --cluster-node-timeout 5000 --appendonly yes'
redis_image='redis:5.0-rc'
network_name='redis_cluster_net'
docker network create $network_name
echo $network_name " created"
#---------- create the cluster ------------------------
@caiogallo
caiogallo / 0_python_email.md
Created August 3, 2018 18:51 — forked from nickoala/0_python_email.md
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@caiogallo
caiogallo / gist:aa307882f149b347c7361ca26df6817c
Created April 30, 2018 14:43
Pipeline do jenkins para deploy com docker
node{
stage('git pull') {
git url: 'https://github.com/caiogallo/ci-sample.git', branch: 'master'
}
stage('build'){
withMaven(maven: 'maven'){
sh 'mvn clean package'
}
}
stage('Build docker images'){
➜ elixir git:(master) make clean test
cd lib/elixir && "/home/caio/Downloads/elixir/rebar" clean
==> elixir (clean)
rm -rf ebin
rm -rf lib/*/ebin
rm -rf lib/elixir/test/ebin
rm -rf lib/*/tmp
rm -rf lib/mix/test/fixtures/git_repo
rm -rf lib/mix/test/fixtures/deps_on_git_repo
rm -rf lib/mix/test/fixtures/git_rebar
@caiogallo
caiogallo / gist:918fc569f86ddaa280e0
Created July 31, 2015 19:39
Select falhas tentativas login
SELECT username, count(1) falhas
FROM sys.dba_audit_session
WHERE returncode != 0
and trunc(timestamp) >= trunc(sysdate)
group by username
union
SELECT '>>TOTAL DE ERROS', count(1) falhas
FROM sys.dba_audit_session
WHERE returncode != 0
and trunc(timestamp) >= trunc(sysdate)
@caiogallo
caiogallo / gist:4733003
Last active August 19, 2016 18:14
Search oracle blocking sessions and generate alter kill session script
select 'ALTER SYSTEM KILL SESSION ''' || sid || ',' || serial# || ''' immediate;'
from
v$session
where
username in ('DEV6SVT_MDS')
order by
blocking_session;