Skip to content

Instantly share code, notes, and snippets.

View olastor's full-sized avatar

Sebastian olastor

  • Munich
  • 06:13 (UTC +02:00)
View GitHub Profile
@Gavinok
Gavinok / chem.rec
Last active January 21, 2024 00:28
Example code used in a video on GNU recutils ( includes both chem.rec and chem.sh)
%rec: periodic_table
%sort: AtomicNumber
# all values came from
# https://pubchem.ncbi.nlm.nih.gov/periodic-table/
AtomicNumber: 1
Symbol: H
Name: Hydrogen
AtomicMass: 1.0080
@m-sean
m-sean / subscraper.py
Last active February 1, 2022 07:15
Subreddit scraper using the Pushshift API.
"""Scrape a specified subreddit for comments using the Pushshift API
(writes JSON objects to disk)"""
import json
import requests
from tqdm import tqdm
from nltk import defaultdict
from time import sleep
SUB = "AskReddit" # subreddit to scrape
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 21, 2025 21:09
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@patmandenver
patmandenver / scp-speed-test.sh
Last active March 28, 2023 04:10
scp speed test between servers
#!/bin/bash
# scp-speed-test.sh
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in MBs]
#
#############################################################
ssh_server=$1
test_file=".scp-test-file"
@kaiyuan01
kaiyuan01 / .travis.yml
Created November 4, 2016 05:11
Travis CI Cordova Android build
language: android
node_js:
- 5.5
notifications:
email: false
sudo: false
@dreikanter
dreikanter / encrypt_openssl.md
Last active March 1, 2025 14:11 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@cgmartin
cgmartin / check-certs.sh
Created January 17, 2016 18:00
Bash SSL Certificate Expiration Check
#!/bin/bash
TARGET="mysite.example.net";
RECIPIENT="[email protected]";
DAYS=7;
echo "checking if $TARGET expires in less than $DAYS days";
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \
| openssl x509 -text \
| grep 'Not After' \
|awk '{print $4,$5,$7}')" '+%s');
in7days=$(($(date +%s) + (86400*$DAYS)));