Skip to content

Instantly share code, notes, and snippets.

View guilhermegazzinelli's full-sized avatar

Guilherme Gazzinelli guilhermegazzinelli

View GitHub Profile
@guilhermegazzinelli
guilhermegazzinelli / android-backup-apk-and-datas.md
Created January 7, 2022 12:38 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@guilhermegazzinelli
guilhermegazzinelli / vnc_install.sh
Created July 15, 2021 22:44
Install vncserver and shows current desktop
#!/bin/bash
echo "Instalando VNC server"
sudo apt install tigervnc-standalone-server tigervnc-scraping-server tigervnc-common tigervnc-xorg-extension tigervnc-viewer
echo "Configure a senha padrão"
vncserver
echo "Realizando backup do arquivo de configuração"
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
@guilhermegazzinelli
guilhermegazzinelli / jsonb_postgres_query.rb
Last active January 6, 2023 14:15
JSON Postgres query
# Sort based on the Hstore data:
Post.order("data->'hello' DESC")
=> #<ActiveRecord::Relation [
#<Post id: 4, data: {"hi"=>"23", "hello"=>"22"}>,
#<Post id: 3, data: {"hi"=>"13", "hello"=>"21"}>,
#<Post id: 2, data: {"hi"=>"3", "hello"=>"2"}>,
#<Post id: 1, data: {"hi"=>"2", "hello"=>"1"}>]>
# Where inside a JSON object:
Record.where("data ->> 'likelihood' = '0.89'")
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
#!/bin/bash
#
# Docker Daemon varsayilan olarak ag iletisimi olmadan
# sadece Unix socket uzerinden calismaktadir.
# Docker Client ve Daemon arasinda HTTPS uzerinden
# guvenli iletisimin kurulmasi icin TLS aktif hale getirilmelidir.
# Client ve Server/daemon arasindaki guvenli iletisim agi
# icin gereken client ve server sertifikasyonlarini
# olusturmaliyiz.
#
@guilhermegazzinelli
guilhermegazzinelli / create_server_certificate.yml
Created June 8, 2020 20:12
Ansible recipe for creating server self-signed certs
---
- name: Create Server Certificate
hosts: localhost
gather_facts: false
vars:
certificate_path: "certs"
private_pass: "change me"
tasks:
- name: Create Directory.
file: