This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String text = "This is a text to be written on the temporary file."; | |
File tempFile = File.createTempFile("tempFilePrefix", "tempFileSuffix", null); | |
FileOutputStream fos = new FileOutputStream(tempFile); | |
fos.write(text.getBytes()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zerotier-cli: missing authentication token and authtoken.secret not found (or readable) in /var/lib/zerotier-one | |
cd /var/lib/zerotier-one | |
sudo chmod +rwx authtoken.secret | |
zerotier-cli join ################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create | |
tmux new -s NAME_OF_TERMINAL | |
#Detach | |
$tmux> tmux detach | |
#Send command | |
tmux send -t NAME_OF_TERMINAL 'command here' C-m | |
#Kill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let uniqueValues = array.map(v => v.property) | |
.filter((value, index, self) => self.indexOf(value) === index); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add to index.html head: | |
<script> | |
if (global === undefined) { | |
var global = window; | |
} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sort -u file.csv > newfile.csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.currentOp().inprog.forEach(function(cop){db.killOp(cop.opid)}) |