Skip to content

Instantly share code, notes, and snippets.

View emilfolino's full-sized avatar

Emil Folino emilfolino

View GitHub Profile
@emilfolino
emilfolino / booklet.js
Created September 28, 2021 13:40
Andra inlämningar
(function() {
const pathname = window.location.pathname;
const queryString = window.location.search;
const courseID = pathname.split("/")[2];
const studentMatch = /student_id=(\d+)/i;
const studentID = queryString.match(studentMatch)[1];
const canvasAuth = "Bearer [ERSÄTT MED egen token]";
const canvasURL = `https://bth.instructure.com/api/v1/courses/${courseID}/assignments`;
@emilfolino
emilfolino / cbsg.bash
Created November 29, 2019 06:42
Corporate Bullshit Generator
curl -s http://pasta.phyrama.com:8083/cgi-bin/live.exe | grep -Eo '^<li>.*</li>' | sed s,\</\\?li\>,,g | shuf -n 1
@emilfolino
emilfolino / vulnerabilities.bash
Last active November 29, 2019 06:37
vulnerabilities
#!/usr/bin/env bash
repos=("slideorama" "auth" "showyourcity" "jsramverk.me" "ramverk2-me" "me-vue" "me-angular" "simulate-stock" "callbacks" "jsramverk" "gomoku")
for repo in "${repos[@]}"
do
echo "$repo"
if [[ ! -d "$repo" ]]; then
git clone "[email protected]:emilfolino/$repo.git"
fi
@emilfolino
emilfolino / correct.bash
Created November 29, 2019 06:36
correct
#!/usr/bin/env bash
PASS=$(pass BTH\ Studkonto)
ssh [email protected] -i /home/efo/.ssh/dbwebb.pub -t "echo $PASS | sudo -S setpre-dbwebb-kurser.bash $3 $1"
dbwebb --yes inspect $1 $2 $3
@emilfolino
emilfolino / httpd-vhosts.conf
Created September 5, 2019 07:28
httpd-vhosts.conf
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
@emilfolino
emilfolino / docker
Created September 3, 2019 07:56
Rätta jsramverk
docker run -it -p 8081:8080 node:10 bash
@emilfolino
emilfolino / grid_to_geodetic.js
Last active May 17, 2019 06:07
rt90 to wgs84
var axis = null;
var flattening = null;
var lat_of_origin = null;
var central_meridian = null;
var scale = null;
var false_northing = null;
var false_easting = null;
function math_cosh(value) {
return 0.5 * (Math.exp(value) + Math.exp(-value));
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> !"hej hopp"
File "<stdin>", line 1
!"hej hopp"
^
SyntaxError: invalid syntax
>>>
> !"hej hopp"
false
> !process.env.node
true
> !process.env.node == "production"
false
> !process.env.node == "development"
false
0|app | ::ffff:127.0.0.1 - - [11/Apr/2019:10:52:19 +0000] "GET /v2/orders?api_key=6d7459cbc693d238e7a9eb9a1dae1bce HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
0|app | ::ffff:127.0.0.1 - - [11/Apr/2019:10:52:24 +0000] "PUT /v2/orders HTTP/1.1" 204 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
0|app | ::ffff:127.0.0.1 - - [11/Apr/2019:10:52:24 +0000] "PUT /v2/products HTTP/1.1" 401 108 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
0|app | ::ffff:127.0.0.1 - - [11/Apr/2019:10:52:24 +0000] "PUT /v2/products HTTP/1.1" 401 108 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
0|app | ::ffff:127.0.0.1 - - [11/Apr/2019:10:53:05 +0000] "GET /v2/products?api_key=6d7459cbc693d238e7a9eb9a1dae1bce HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
0|app | ::ffff:127.0.0.1 -