Skip to content

Instantly share code, notes, and snippets.

View cnmoro's full-sized avatar
🎯
Focusing

Carlo Moro cnmoro

🎯
Focusing
View GitHub Profile
@cnmoro
cnmoro / Remove Auto Activate Base from Conda
Created November 6, 2019 14:35
Remove Auto Activate Base from Conda
conda config --set auto_activate_base False
@cnmoro
cnmoro / Cedilha Linux Mint Teclado Americano
Created October 30, 2019 20:39
Cedilha Linux Mint Teclado Americano
@https://superuser.com/questions/1075992/cedilla-under-c-%c3%a7-in-us-international-with-dead-keys-keyboard-layout-in-linu
Layout:
English (US, intl., with dead keys)
1. Edit configuration files:
sudo vim /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
sudo vim /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache
On both, find the lines starting with "cedilla" "Cedilla" and add :en to the line. Something like this:
@cnmoro
cnmoro / Apache Drill 1.15 Mongo Config
Created October 22, 2019 14:59
Apache Drill 1.15 Mongo Config
http://localhost:8047
Options>
drill.exec.functions.cast_empty_string_to_null : true.
store.mongo.all_text_mode : true.
store.mongo.bson.record.reader : false.
--
@cnmoro
cnmoro / MongoDB Kill all operations
Created October 22, 2019 13:31
MongoDB Kill all operations
db.currentOp().inprog.forEach(function(cop){db.killOp(cop.opid)})
@cnmoro
cnmoro / Remove duplicate lines from text file
Created October 22, 2019 13:06
Remove duplicate lines from text file
sort -u file.csv > newfile.csv
@cnmoro
cnmoro / Fix 'Uncaught ReferenceError: global is not defined'
Created October 17, 2019 19:45
Fix 'Uncaught ReferenceError: global is not defined'
Add to index.html head:
<script>
if (global === undefined) {
var global = window;
}
</script>
@cnmoro
cnmoro / JS Map Distinct
Created October 16, 2019 17:04
JS Map Distinct
let uniqueValues = array.map(v => v.property)
.filter((value, index, self) => self.indexOf(value) === index);
@cnmoro
cnmoro / Linux Tmux Commands
Last active October 14, 2019 18:51
Linux Tmux Commands
#Create
tmux new -s NAME_OF_TERMINAL
#Detach
$tmux> tmux detach
#Send command
tmux send -t NAME_OF_TERMINAL 'command here' C-m
#Kill
@cnmoro
cnmoro / x11vnc-stack-smashing-detected-solution.mk
Last active October 8, 2019 13:49 — forked from mangoliou/x11vnc-stack-smashing-detected-solution.mk
x11vnc `stack smashing detected` solution.
# Install x-related to compile x11vnc from source code.
sudo apt-get update
sudo apt-get install -y libxtst-dev libssl-dev libjpeg-dev
# Grep source code.
wget http://x11vnc.sourceforge.net/dev/x11vnc-0.9.14-dev.tar.gz
gzip -dc x11vnc-0.9.14-dev.tar.gz | tar -xvf -
cd x11vnc-0.9.14/
./configure --prefix=/usr/local CFLAGS='-g -O2 -fno-stack-protector -Wall'
@cnmoro
cnmoro / Python Remover Acentos
Created October 3, 2019 15:57
Python Remover Acentos
import re
import unicodedata
def strip_accents(text):
try:
text = unicode(text, 'utf-8')
except (TypeError, NameError):
pass
text = unicodedata.normalize('NFD', text)
text = text.encode('ascii', 'ignore')