Skip to content

Instantly share code, notes, and snippets.

@sidartaoliveira
sidartaoliveira / docker-compose-hackintosh.md
Created March 23, 2021 03:48 — forked from slykar/docker-compose-hackintosh.md
Docker and Docker Compose on AMD OSX Hackintosh via Docker Machine

Introduction

Docker.app will complain about incompatible processor, so we will use Docker Machine.

Instalation

Download Docker for Mac (Docker.app). It contains some binaries that are necessary.

brew install virtualbox docker-machine
@sidartaoliveira
sidartaoliveira / iterm2.md
Created February 16, 2021 23:26 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@sidartaoliveira
sidartaoliveira / postmortem.txt
Created May 22, 2020 12:27 — forked from RomuloOliveira/postmortem.txt
Template #postmortem
Produto: {produto}
Problema:
{O que aconteceu}
Linha do tempo e troubleshooting:
{data}:
@sidartaoliveira
sidartaoliveira / letsencrypt_2019.md
Created February 15, 2020 21:37 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@sidartaoliveira
sidartaoliveira / deployment.yaml
Created January 27, 2020 10:33 — forked from NiklasMerz/deployment.yaml
Github Actions Kubernetes Deploy
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: myproject
name: myproject
namespace: default
spec:
progressDeadlineSeconds: 600
replicas: 1
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<-SCRIPT
apt update
apt -y upgrade
apt install -y make gcc bison libssl-dev libelf-dev flex
cd /home/vagrant/ && git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git && chown -R vagrant. linux*
cd /home/vagrant/linux && yes "" | make olddefconfig && make localmodconfig && make -j16 && sudo make modules_install && sudo make install
SCRIPT

Keybase proof

I hereby claim:

  • I am sidartaoliveira on github.
  • I am sidarta (https://keybase.io/sidarta) on keybase.
  • I have a public key ASCJf5MM2I5a0XWEVcsYSadCGG6AMkJN7zDmrmXRuNPWCAo

To claim this, I am signing this object:

# enable sofware update automatic
sudo /usr/bin/defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool TRUE &&
sudo /usr/bin/defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool TRUE &&
sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticallyInstallMacOSUpdates -bool TRUE &&
sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool TRUE &&
sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool TRUE &&
sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool TRUE &&
sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool TRUE
AutomaticDownload
#!/usr/bin/python
import serial
ser = serial.Serial('/dev/ttyUSB1')
ser.flushInput()
ser.flushOutput()
while True:
data_raw = ser.readline()
print(data_raw.rstrip('\n'))
#!/usr/bin/python
from serial import Serial
ser = Serial('/dev/ttyUSB0')
print(ser.name)
ser.write(b'test\n')
print(ser.readline())
ser.close()