Skip to content

Instantly share code, notes, and snippets.

x10an14 /
Created Jan 25, 2022
Forskjell på filosofi
liste_tall = [1, 2, 3, 4, 5, 6]
def summere_imperativt(liste):
sum = 0
for tall in liste:
sum += sum
return sum
def summere_deklarativt(liste):
sum = reduce(x + y, liste)
#!/usr/bin/env bash
echo 'Setting up steam network namespace...'
sudo ip netns add steam_ns
sudo ip netns exec steam_ns ip addr add dev lo
sudo ip netns exec steam_ns ip link set lo up
#!/usr/bin/env python3.6
from contextlib import suppress
from pathlib import Path, PosixPath
from subprocess import run, PIPE
from sys import exit, argv
from sys import stderr, executable
if __name__ == '__main__':
View gist:7b9b974a005a10a2f5826c4bfe090c89
[2018.03.16T22:02:22CET] x10an14@x10-P65xRP ~/overtime-calculator (minor_changes *% u= origin/minor_changes) $ pipenv run python -m coverage run -m py.test -v
==================================================================================================================== test session starts =====================================================================================================================
platform linux -- Python 3.6.3, pytest-3.4.2, py-1.5.2, pluggy-0.6.0 -- /home/x10an14/.local/share/virtualenvs/overtime-calculator-Z0nwGDbO/bin/python
cachedir: .pytest_cache
rootdir: /home/x10an14/Documents/github/overtime-calculator, inifile: setup.cfg
plugins: hypothesis-3.49.1
collected 7 items
overtime_calculator/tests/ FAILED
x10an14 / Installation of Ubuntu 16.04 LTS VM on Windows 10
Created Mar 16, 2018
Installation of Ubuntu 16.04 LTS VM on Windows 10 HyperV
View Installation of Ubuntu 16.04 LTS VM on Windows 10

Installation of Ubuntu 16.04 LTS VM on Windows 10 HyperV

Installation steps executed:

  1. Selected "Generation 2" VM during installation wizard
    • So as to choose UEFI as default boot mode.
  2. Turned off SecureBoot
    1. By following these instructions in an admnin-escalated powershell terminal.
  3. Added video=hyperv_fb:1920x1200 to GRUB_CMDLINE_LINUX_DEFAULT to use the full available resolution of the laptop monitor (in fullscreen).
  4. Replaced english keyboard with norwegian inside of the VM 'try ubuntu live' session.
x10an14 / docker-compose.yaml
Last active Mar 12, 2018
docker-compose.yaml, normal output, and verbose output. Unable to start server through `docker-compose up`
View docker-compose.yaml
# Docker compose file syntax:
version: '2'
image: drone/drone:0.8
- 5124:8000
- 5125:9000
x10an14 /
Last active May 1, 2019
Unable to find
x10an14@x10Desktop2016:~/Documents/git_projs/toml$ sudo apt-get install golang
[sudo] password for x10an14:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-72 linux-headers-4.4.0-72-generic linux-image-4.4.0-72-generic
linux-image-extra-4.4.0-72-generic linux-signed-image-4.4.0-72-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
x10an14 /
Last active Dec 4, 2016
Why u no such html content when accessing this endpoint? =(
x10an14@x10Desktop2016:~/Documents/git_projs/overtime_calculator$ venv/bin/python
2016-12-04 22:44:47,201: DEBUG:
▀▀▀██████▄▄▄ _______________
▄▄▄▄▄ █████████▄ / \
▀▀▀▀█████▌ ▀▐▄ ▀▐█ | Gotta go fast! |
▀▀█████▄▄ ▀██████▄██ | _________________/
▀▄▄▄▄▄ ▀▀█▄▀█════█▀ |/
▀▀▀▄ ▀▀███ ▀ ▄▄
▄███▀▀██▄████████▄ ▄▀▀▀▀▀▀█▌
View gist:a214406122949bf060c84b80fc386829
x10an14@x10Desktop2016:~/Documents/git_projs/coconut$ docker run -it --entrypoint sh coconut_ipython:3.4-alpine
/usr/coconut # make test
pytest --strict -s tests
============================================================================================ test session starts =============================================================================================
platform linux -- Python 3.4.5, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
rootdir: /usr/coconut, inifile:
collected 20 items
> coconut -s -c msg = '<success>'; pmsg = print$(msg); `pmsg`
x10an14 / Attempt_nr2.txt
Last active Sep 30, 2016
Coconut test segfault in minimized alpine docker container image
View Attempt_nr2.txt
$ docker run -it --entrypoint bash test
bash-4.3# coconut tests/src/extras.coco tests/dest --run
Coconut: Compiling tests/src/extras.coco ...
Coconut: Compiled to tests/dest/ .
CoconutWarning: missing new line at end of file (line 1)
CoconutWarning: missing new line at end of file (line 1)