Skip to content

Instantly share code, notes, and snippets.

View medeiros's full-sized avatar
⚙️
age quod agis

Daniel medeiros

⚙️
age quod agis
View GitHub Profile
@medeiros
medeiros / wsl-go-openssl-proxyissues.txt
Last active May 22, 2024 14:30
wsl/ubuntu config to download go packages behind enterprise proxy
$ go mod tidy
go: finding module for package rsc.io/quote
examples/hello imports
rsc.io/quote: module rsc.io/quote: Get "https://proxy.golang.org/rsc.io/quote/@v/list": x509: certificate signed by unknown authority
$ openssl s_client -connect proxy.golang.org:443 </dev/null
...
Verify return code: 20 (unable to get local issuer certificate)
...
@medeiros
medeiros / get_gists.py
Created May 3, 2020 10:58
Python script to backup gists
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
@medeiros
medeiros / keyboard-abnt2.sh
Last active May 2, 2020 22:18
Change keyboard type in Arch Linux to Brazillian Portuguese (ABNT2)
#!/bin/bash
# default in /etc/vconsole.conf; this is an exception
setxkbmap -model abnt2 -layout br -variant abnt2
@medeiros
medeiros / bluetooth-headset.sh
Last active May 2, 2020 22:06
Bluetooth headset connection in Arch Linux
#!/bin/bash
# in /etc/pulse/default.pa - make sure modules module-bluetooth-policy
# and module-bluetooth-discover are loaded
# in /etc/bluetooth/audio.conf, make sure that the configuration is as below:
# [General]
# Enable=Headset,Source,Sink
# Disable=Socket
@medeiros
medeiros / gist:f4caaddef947eb817c791f23fe0e2b4b
Created October 4, 2019 08:23 — forked from nilo/gist:c2a31a0f9f29c88145ca
Using cedilha - ArchLinux Cinnamon
Author: Nilo Dantas - n1lo
Based on: https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/518056 - helio-valente post
How to use Cedilha on US Keyboard on ArchLinux
1) Put: English(US, internacional with dead Keys) on your system keyboard layout.
2) Editing the files:
sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache
@medeiros
medeiros / oracle-useful-queries.sql
Created October 4, 2019 08:21
Oracle useful queries
-- query que indica a sessao travando alguma tabela (Oracle)
SELECT O.OBJECT_NAME, S.SID, S.SERIAL#, P.SPID, S.PROGRAM,S.USERNAME,
S.MACHINE,S.PORT , S.LOGON_TIME,SQ.SQL_FULLTEXT
FROM V$LOCKED_OBJECT L, DBA_OBJECTS O, V$SESSION S,
V$PROCESS P, V$SQL SQ
WHERE L.OBJECT_ID = O.OBJECT_ID
AND L.SESSION_ID = S.SID AND S.PADDR = P.ADDR
AND S.SQL_ADDRESS = SQ.ADDRESS;
@medeiros
medeiros / encoding-data
Last active October 4, 2019 08:22
General information about encoding
# Java supported encodings
https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html
@medeiros
medeiros / jvm-params.sh
Last active October 4, 2019 08:18
Some cool JVM params
#To print how much memoru is allocated for some process
java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
# Avoiding JVM Delays Caused by Random Number Generation (https://docs.oracle.com/cd/E40972_01/doc.70/e40973/cnf_jvmrand.htm)
# The library used for random number generation in Oracle's JVM relies on /dev/random by default for UNIX platforms.
# This can potentially block the WebRTC Session Controller process because on some operating systems
# /dev/random waits for a certain amount of "noise" to be generated on the host system before returning a result.
# Although /dev/random is more secure, Oracle recommends using /dev/urandom if the default JVM configuration
# delays WebRTC Session Controller startup.
@medeiros
medeiros / copy-arrays.java
Created September 10, 2019 10:09
Way to copy two arrays in Java
String[] concatenate(String[] values, String[] otherValues) {
int aLen = values.length;
int bLen = otherValues.length;
String[] result = new String[aLen + bLen];
System.arraycopy(values, 0, result, 0, aLen);
System.arraycopy(otherValues, 0, result, aLen, bLen);
return result;
@medeiros
medeiros / git-common-commands
Created September 10, 2019 10:08
git commands for removal and undo
git clean -f: para untracked files
git reset --hard: para modified tracked files