This file contains 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
#PRIMES - 08/06/2013 - LAST EDIT: 09/09/2013 | |
#lucaszanella.com - Primes v1.1 | |
#this is a fast implementation, just for fun. Not the best implementation, but... | |
#methods: | |
#var = primes.create() | |
#--var.generate(max) - generate primes up to 'max' (return: list) | |
#--var.count(start, end) - count number of primes from 'start' to 'end' (return: int) |
This file contains 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
/home/lucas/tcptunnel/tcptunnel --local-port=443 --remote-port=8443 --remote-host=mac.lucaszanella.com --stay-alive |
This file contains 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
//Experimental nginx and php docker composer | |
docker-compose.yml: | |
web: | |
image: nginx:latest | |
ports: | |
- "80:80" | |
- "443:443" | |
volumes: |
This file contains 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 serial | |
ser = serial.Serial('/dev/ttyACM0', 9600) | |
while 1: | |
serial_line = ser.readline() | |
print(str(serial_line).replace('\n', '')) | |
ser.close() |
This file contains 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 os | |
def pick2(n): | |
pages.append(a[n]) | |
pages.append(b[n]) | |
def concatenate_list_data(list): | |
result= '' | |
for element in list: |
This file contains 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
ssh -p 2324 -i privatekey -L 8080:192.168.1.1:80 -C -q -D 1234 user@host |
This file contains 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
https://unix.stackexchange.com/a/244379 | |
dd if=/dev/sdb bs=4096 count=$(($(stat -c '%s' the.iso) / 4096)) | sha256sum |
This file contains 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
docker run --name nginx --rm -p 8080:80 -v /home/lz/Downloads:/usr/share/nginx/html:ro -d nginx |
This file contains 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
#Work in progress... Didnt finish this script yet | |
#With sudo: | |
sudo docker run --name nginx --rm -p 8080:80 -v /home/lz/Downloads:/usr/share/nginx/html:ro -d --entrypoint sed nginx '/location \/ {/a autoindex on;' /etc/nginx/conf.d/default.conf && sudo docker exec -ti nginx "nginx -g daemon off" | |
sudo docker run --name nginx --rm -p 8080:80 -v /home/lz/Downloads:/usr/share/nginx/html:ro -ti -d --entrypoint sed nginx '/location \/ {/a autoindex on;' /etc/nginx/conf.d/default.conf && sudo docker exec -ti nginx "nginx -g daemon off" | |
#Without sudo: |
This file contains 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
Fixes mouse problem in new VMs on virt-manager | |
sudo virt-xml $vmname --add-device --input tablet |
OlderNewer