Skip to content

Instantly share code, notes, and snippets.

View emilfolino's full-sized avatar

Emil Folino emilfolino

View GitHub Profile
@emilfolino
emilfolino / super-correct
Created April 10, 2019 06:09
super-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"
dbwebb --yes inspect $1 $2 $3
@emilfolino
emilfolino / log-gui-main.ansi
Created March 14, 2019 10:30
log-gui-main.ansi
>>> ======= GUI Inspect =======
Thu Mar 14 11:26:22 CET 2019
algn18 kmom06
download, docker
Inspect GUI v1.3.1 (2019-03-12)
http://www.student.bth.se/~algn18/dbwebb-kurser/databas/me/redovisa
@emilfolino
emilfolino / log-gui-inspect.ansi
Created March 14, 2019 10:29
log-gui-inspect.ansi
---> Run container= with what= one off command.
[ ! -f docker-compose.yaml ] || docker-compose -f docker-compose.yaml run cli make inspect what=kmom06 options='--yes'
Pulling cli (dbwebb/courserepo:cli)...
cli: Pulling from dbwebb/courserepo
---> Execute dbwebb inspect what=kmom01.
env PATH='/home/dbwebb/repo/bin:/home/dbwebb/repo/vendor/bin:/home/dbwebb/repo/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' bin/dbwebb-inspect --yes . kmom06
#
# Thu Mar 14 10:26:53 UTC 2019
# dbwebb-inspect version v2.4.0 (2019-03-05)
#
function _makefile_targets {
local curr_arg;
local targets;
# Find makefile targets available in the current directory
targets=''
if [[ -e "$(pwd)/Makefile" ]]; then
targets=$( \
grep -oE '^[a-zA-Z0-9_-]+:' Makefile \
| sed 's/://' \
@emilfolino
emilfolino / gist:139a871d19a5dce59a8939a3ee771d7e
Created October 1, 2018 09:17
pylint: error: no such option: -s
WARNING pylint failed: './example/cgi/execute-another-file.cgi'
Usage: pylint [options] module_or_package
Check that a module satisfies a coding standard (and more !).
pylint --help
Display this help message and exit.
pylint --help-msg <msg-id>[,<msg-id>]
Anax: Uncaught exception:
Call to undefined function Anax\Url\mb_strtolower()
Code: 0
#0 /home/efo/htdocs/dbwebb.se/vendor/mos/anax/src/Content/CFileBasedContent.php(843): Anax\Url\CUrl->slugify('')
#1 /home/efo/htdocs/dbwebb.se/vendor/mos/anax/src/Content/CFileBasedContent.php(866): Anax\Content\CFileBasedContent->contentForInternalRoute('')
#2 /home/efo/htdocs/dbwebb.se/vendor/mos/anax/config/routes/default.php(13): Anax\Content\CFileBasedContent->contentForRoute()
#3 [internal function]: Anax\App\CAnaxDefault->{closure}()
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@emilfolino
emilfolino / gist:8b29f5789847fa94d2c6dd4c5bb17711
Created February 19, 2018 08:24
Felmeddelanden studserver
Får massa såna här när jag kör npm install, för olika packet.
npm WARN tar ENOENT: no such file or directory, lstat '/home/saxon/teachers/dipt/efostud/git/order_api/node_modules/.staging/nyc-364d72b2/node_modules/yargs'
Sen får jag ett fel till slut:
npm ERR! path /home/saxon/teachers/dipt/efostud/git/order_api/node_modules/.staging/nyc-364d72b2/node_modules/yallist
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
# 4(2R + r) = 1 Ekvation #1
# R = 1/8 - r/2
# R = 1/8 - (1/12 - R/3)/2
# 2R + 1/12 - R/3 = 1/4
# 5R = 1/2
#
R=1/10
#
#
# 4(R + 3r) = 1 Ekvation #2
@emilfolino
emilfolino / tsp.rs
Created May 11, 2017 07:35
Travelling salesperson Rust implementation
use std::collections::HashMap;
fn main() {
let mut universities = HashMap::new();
universities.insert("BTH", (56.18, 15.59));
universities.insert("Uppsala", (59.85, 17.63));
universities.insert("Lund", (55.71, 13.20));
universities.insert("KTH", (59.34, 18.07));
universities.insert("Chalmers", (57.68, 11.97));
universities.insert("Luleå", (65.61, 22.14));