Skip to content

Instantly share code, notes, and snippets.

View andrealmar's full-sized avatar
🏠
Working from home

Andre Almar andrealmar

🏠
Working from home
View GitHub Profile
@andrealmar
andrealmar / pure-impure.md
Created August 16, 2018 00:10 — forked from tomekowal/pure-impure.md
Pure vs impure

Pure vs impure and why should I care?

Some of the most important advancements in programming came from adding restrictions to the way we program. Famous article by Edsger Dijkstra Go To Statement Considered Harmful shows how introducing one statement into programming language breaks many nice properties of that language. goto gives us freedom and solves couple of simple problems like breaking from nested loops easily, but it can make programs very hard to understand. This happens, because we cannot look at two pieces of code in spearation. The execution can jump to some other place in code or even worse: it can jump from other piece of code to here and We need to keep that in mind.

In order to work the Bose QC35 Headset Bluetooth do the following:
- sudo pacman -Syu pulseaudio-alsa pulseaudio-bluetooth bluez bluez-libs bluez-utils
- turn off bluetooth from your computer
- sudo btmgmt ssp of
- gpasswd -a YOUR_USER lp

Keybase proof

I hereby claim:

  • I am andrealmar on github.
  • I am andrealmar (https://keybase.io/andrealmar) on keybase.
  • I have a public key ASBVrFj0dzmy_-oL1agIHIuNoRm49y8T-1-kDTGc0yqVSQo

To claim this, I am signing this object:

du -sh /var/* | sort -n
# Author: Andre Almar - andre@y7mail.com
import os, subprocess
from subprocess import call
print 'Validando FileSystem /webaplic'
if os.path.isdir('/webaplic'):
print "Diretorio /webaplic ja existe"
else:
try:
# TO RUN the WLST script just type the command below:
# /webtools/oracle/plat1200_1/middleware/oracle_common/common/bin/wlst.sh weblogic_ad_users.py
# Author: ANDRE ALMAR
servidor = raw_input('Digite o servidor: ')
porta = raw_input('Digite a porta: ')
usuario = raw_input('Digite o usuario: ')
password = raw_input('Digite o password: ')
roles = ['Deployer', 'Monitor', 'Operator', 'IntegrationDeployer', 'IntegrationMonitor', 'IntegrationOperator']
@andrealmar
andrealmar / vi_find_replace.txt
Created November 28, 2017 11:49
vi find and replace
Então mudaremos, na própria linha de comando do vi, a palavra "amamu" pelo correto, amamos.
Sendo key-sensitive a utilização deste comando, execute:
:%s/amamu/amamos/g
@andrealmar
andrealmar / latency.txt
Created September 29, 2017 20:12 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
-p # port binding eg.HOST:CONTAINER - 5433:5432
-e # env variabls
# Run a container mounting an outside volume inside the container
docker run -it -v /Users/andrealmar/primeiro_dockerfile/:/volume alpine
# Inspect mounted volume of a Container
docker inspect -f {{.Mounts}} 8a73d606bd9c
# creating and executing a PostgreSQL container using another container as a Volume