Skip to content

Instantly share code, notes, and snippets.

View xoriole's full-sized avatar

S. Pan xoriole

  • Delft, The Netherlands
View GitHub Profile
@xoriole
xoriole / openssl-macos-paths
Created November 15, 2020 21:03
Openssl paths - macOS
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs
and run
/usr/local/opt/openssl@1.1/bin/c_rehash
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
@xoriole
xoriole / snapcraft.yaml
Created January 14, 2020 11:07
Tribler snapcraft.yaml [7.5.0+]
name: tribler-bittorrent
version: 7.4.0
summary: Tribler
description: >
Peer-to-peer Bittorrent client with enhanced privacy. Search and download torrents with less worries or censorship.
grade: devel
confinement: devmode
base: core18
@xoriole
xoriole / stable.Dockerfile
Created January 14, 2020 10:40
Snapcraft docker - Core18
FROM ubuntu:bionic as builder
# Grab dependencies
RUN apt-get update
RUN apt-get dist-upgrade --yes
RUN apt-get install --yes \
curl \
jq \
squashfs-tools
import ast
import os
import sys
location = os.path.abspath(sys.argv[1])
exclude_from_check = ['twisted/plugins/tunnel_helper_plugin.py']
for (dirpath, dirnames, filenames) in os.walk(location):
for filename in filenames:
FROM triblertester/ipv8-p4a:latest
VOLUME /dist
WORKDIR /home/user
#RUN rm -rf /home/user/.local/lib/python2.7/site-packages/pythonforandroid
RUN mkdir -p /home/user/.local/lib/python2.7/site-packages
RUN if test -L /home/user/.local/lib/python2.7/site-packages/pythonforandroid; then ln -s /home/user/pythonforadnroid /home/user/.local/lib/python2.7/site-packages/pythonforandroid; fi
RUN rm -rf /home/user/ipv8-android-service && git clone -b jenkins_wild https://github.com/Tribler/ipv8-android-service.git && cp -r ipv8-android-service/recipes/* ~/pythonforandroid/recipes
@xoriole
xoriole / version.py
Created June 20, 2019 10:39
Generates Tribler community version file
import base64
import json
from binascii import unhexlify
import requests
from ipv8.keyvault.crypto import default_eccrypto
def get_version():
events_url = "http://localhost:8085/events"
@xoriole
xoriole / Delegation.sol
Created May 30, 2019 16:29
Example contracts showing delegate call
pragma solidity ^0.5.1;
contract Application {
uint public n;
address public sender;
function setN(uint _n) public {
n = _n;
sender = msg.sender;
}
@xoriole
xoriole / Dockerfile
Last active May 29, 2019 15:40
IPv8 android service dockerfile
FROM triblertester/ipv8-p4a:latest
WORKDIR /home/user
#RUN rm -rf /home/user/.local/lib/python2.7/site-packages/pythonforandroid
RUN mkdir -p /home/user/.local/lib/python2.7/site-packages
RUN if test -L /home/user/.local/lib/python2.7/site-packages/pythonforandroid; then ln -s /home/user/pythonforadnroid /home/user/.local/lib/python2.7/site-packages/pythonforandroid; fi
RUN rm -rf /home/user/ipv8-android-service && git clone https://github.com/Tribler/ipv8-android-service.git && cp -r ipv8-android-service/recipes/* ~/pythonforandroid/recipes
@xoriole
xoriole / AlumniCredits.sol
Last active April 30, 2018 01:14
Token example 2 - Alumni Credits
pragma solidity ^0.4.12;
contract AlumniCredits {
string public name = "EIT Digital Alumni Credits";
string public symbol = "EITDAC";
uint8 public decimals = 2;
uint256 public totalSupply;
// Foundation address
@xoriole
xoriole / MyFirstToken.sol
Created April 30, 2018 00:28
Token example 1 - First Token
pragma solidity ^0.4.12;
contract MyFirstToken {
string public name = "MyFirstToken";
string public symbol = "MFT";
uint8 public decimals = 2;
uint256 public totalSupply;
// This creates an array with all balances