Skip to content

Instantly share code, notes, and snippets.

@pbt001
pbt001 / crypto_p1.ipynb
Last active November 7, 2021 14:58 — forked from adikamath/crypto_p1.ipynb
[CryptoCompare API] Manual to CryptoCompare API written in a jupyter notebook #crypto #jupiter
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pbt001
pbt001 / awesome-selfhosted-sorted-by-stars.md
Last active June 22, 2020 09:17 — forked from kvnxiao/awesome-selfhosted-sorted-by-stars.md
[Self hosting References] awesome-selfhosted-sorted-by-stars.md

Awesome-Selfhosted

Awesome

Selfhosting is the process of locally hosting and managing applications instead of renting from SaaS providers.

This is a list of Free Software network services and web applications which can be hosted locally. Non-Free software is listed on the Non-Free page.

See Contributing.

@pbt001
pbt001 / Blockchain security research.md
Last active June 22, 2020 09:16 — forked from TheHackerDev/Blockchain security research.md
[Blockchain Introduction] Open-source blockchain security research (contributions welcome!) #crypto #blockchain

What is a blockchain?

  • Distributed ledger system; for tracking the transfer of tokens (currency, data of any type).
  • A cross between economics, cryptography, and the internet.
    • Side note- if you ever wanted a financial incentive to get involved in cryptography, this is it.
  • A blockchain is literally a chain of blocks, where each block contains a list of transactions that everyone agrees have occurred.
    • Each block builds upon all the ones before it.

A blockchain is literally a chain of blocks

@pbt001
pbt001 / free_courses.csv
Last active June 22, 2020 09:15
[Learn for free list] 190 universities just launched 600 free online courses. Here’s the full list. - https://qz.com/1437623/600-free-online-courses-you-can-take-from-universities-worldwide/
Category Title URL
Programming CS50’s Introduction to Game Development from Harvard University https://www.class-central.com/course/edx-cs50-s-introduction-to-game-development-11504
Programming CS50’s Mobile App Development with React Native from Harvard University https://www.class-central.com/course/edx-cs50-s-mobile-app-development-with-react-native-11505
Programming CS50’s Web Programming with Python and JavaScript from Harvard University https://www.class-central.com/course/edx-cs50-s-web-programming-with-python-and-javascript-11506
Programming Functions, Methods, and Interfaces in Go from University of California, Irvine https://www.class-central.com/course/coursera-functions-methods-and-interfaces-in-go-12050
Programming Concurrency in Go from University of California, Irvine https://www.class-central.com/course/coursera-concurrency-in-go-12047
Programming Getting Started with Go from University of California, Irvine https://www.class-central.com/course/coursera-getting-started-with-go-1204
import docx
# general routine for finding and replacing text in a docx
def docx_find_replace_text(search_text, replace_text, paragraphs):
"""Replace strings and retain the same style.
The text to be replaced can be split over several runs so
search through, identify which runs need to have text replaced
then replace the text in those identified
"""
@pbt001
pbt001 / caddy.sh
Created June 22, 2020 21:01 — forked from Jamesits/caddy.sh
Install Caddy Server on Ubuntu with Systemd.
# Should work on all Debian based distros with systemd; tested on Ubuntu 16.04+.
# This will by default install all plugins; you can customize this behavior on line 6. Selecting too many plugins can cause issues when downloading.
# Run as root (or sudo before every line) please. Note this is not designed to be run automatically; I recommend executing this line by line.
apt install curl
curl https://getcaddy.com | bash -s personal dns,docker,dyndns,hook.service,http.authz,http.awses,http.awslambda,http.cache,http.cgi,http.cors,http.datadog,http.expires,http.filemanager,http.filter,http.forwardproxy,http.geoip,http.git,http.gopkg,http.grpc,http.hugo,http.ipfilter,http.jekyll,http.jwt,http.locale,http.login,http.mailout,http.minify,http.nobots,http.prometheus,http.proxyprotocol,http.ratelimit,http.realip,http.reauth,http.restic,http.upload,http.webdav,net,tls.dns.auroradns,tls.dns.azure,tls.dns.cloudflare,tls.dns.cloudxns,tls.dns.digitalocean,tls.dns.dnsimple,tls.dns.dnsmadeeasy,tls.dns.dnspod,tls.dns.dyn,tls.
@pbt001
pbt001 / resticheat.md
Created June 22, 2020 21:01 — forked from perfecto25/resticheat.md
Restic cheatsheet

Restic backup application - commands cheatsheet

Installation & config

  1. add Retic repo
  2. yum install restic

add a Restic credential file to root

vim /root/.restic
@pbt001
pbt001 / backup.sh
Created June 22, 2020 21:02 — forked from skrajewski/backup.sh
Automate your macOS backup to Backblaze B2 using Restic and launchd.
#!/bin/bash
PID_FILE=~/.restic_backup.pid
TIMESTAMP_FILE=~/.restic_backup_timestamp
if [ -f "$PID_FILE" ]; then
if ps -p $(cat $PID_FILE) > /dev/null; then
echo $(date +"%Y-%m-%d %T") "File $PID_FILE exist. Probably backup is already in progress."
exit 1
else
@pbt001
pbt001 / backup.sh
Created June 22, 2020 21:02 — forked from russelldavies/backup.sh
Restic backup script
#!/bin/sh
if [ $# -lt 4 ]; then
echo $0: Missing arguments
echo usage: $0 repo password aws_access_key aws_secret_key
exit 1
fi
export RESTIC_PASSWORD=$1
export RESTIC_PASSWORD=$2
@pbt001
pbt001 / restic-backup.sh
Created June 22, 2020 21:23 — forked from chluehr/restic-backup.sh
Backup via restic to Backblaze
#!/bin/bash
#
# Setup:
# wget https://github.com/restic/restic/releases/download/v0.7.3/restic_0.7.3_linux_amd64.bz2
# bunzip2 restic_0.7.3_linux_amd64.bz2
# mv restic_0.7.3_linux_amd64 /usr/local/bin/restic
# chmod a+x /usr/local/bin/restic
#
# crontab -e
# 0 1 * * * /root/bin/restic-backup.sh 2>&1 >>/var/log/restic-backup.log