I hereby claim:
- I am tapionx on github.
- I am tapion (https://keybase.io/tapion) on keybase.
- I have a public key ASAZh5EpqWHE10BQAwYTidvFsLIiInhVvD1Rv7ukP6SP4wo
To claim this, I am signing this object:
int id; | |
/* Faccio puntare le aree delle altre CPU all'array dichiarato */ | |
for(id=0;id<NUM_CPU;id++){ | |
if (id == 0){ | |
/* Refer to the Rom Reserved Frame */ | |
pnew_old_areas[id][OLD_SYSBP] = (state_t *)SYSBK_OLDAREA; | |
pnew_old_areas[id][NEW_SYSBP] = (state_t *)SYSBK_NEWAREA; | |
pnew_old_areas[id][OLD_TRAP] = (state_t *)PGMTRAP_OLDAREA; | |
pnew_old_areas[id][NEW_TRAP] = (state_t *)PGMTRAP_NEWAREA; | |
pnew_old_areas[id][OLD_TLB] = (state_t *)TLB_OLDAREA; |
#!/bin/bash | |
if [ "`id -u`" -eq 0 ]; then | |
if [ "$2" ]; then | |
INIF=$1 | |
OUTIF=$2 | |
iptables --table nat -I POSTROUTING 1 --out-interface $OUTIF -j MASQUERADE | |
iptables -I FORWARD 1 --in-interface $INIF -j ACCEPT | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
else |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# requirements: pip install requests-html | |
import json | |
from requests_html import HTMLSession | |
import requests | |
desired_country_code = 'IT' | |
session = HTMLSession() |
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); docker volume rm $(docker volume ls -q) |
[Interface] | |
Address = 10.8.0.1/24 | |
PrivateKey = XXXXXXXXXX | |
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | |
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE | |
ListenPort = 51821 | |
[Peer] | |
PublicKey = XXXXXXXXXX | |
AllowedIPs = 10.8.0.2/24 |
with open('1_input.txt', 'r') as f: | |
input_data = f.readlines() | |
def fuel_requirement(mass): | |
fuel_needed = (mass / 3) - 2 | |
while fuel_needed > 0: | |
fuel_needed += (fuel_needed / 3) - 2 | |
print(fuel_requirement(14)) | |
print(fuel_requirement(1969)) | |
print(fuel_requirement(100756)) | |
fuel_sum = 0 |
with open('1_input.txt', 'r') as f: | |
input_data = f.readlines() | |
def fuel_requirement(mass): | |
fuel_needed = (mass / 3) - 2 | |
if fuel_needed > 0: | |
return fuel_needed + fuel_requirement(fuel_needed) | |
else: | |
return 0 | |
print(fuel_requirement(14)) | |
print(fuel_requirement(1969)) |
with open('2_input.txt', 'r') as f: | |
input_program = [int(x) for x in f.read().strip().split(',')] | |
input_program[1] = 12 | |
input_program[2] = 2 | |
def execute_intcode(input_program): | |
program_counter = 0 | |
while program_counter < len(input_program) and input_program[program_counter] != 99: | |
#print(program_counter, input_program[program_counter]) | |
opcode = input_program[program_counter] | |
input1_address = input_program[program_counter + 1] |