This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run with `sudo` | |
MOUNTED_DISK=$1 | |
umount ${MOUNTED_DISK}/run | |
umount ${MOUNTED_DISK}/sys | |
umount ${MOUNTED_DISK}/dev/pts | |
umount ${MOUNTED_DISK}/dev | |
umount ${MOUNTED_DISK}/proc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>AppleAntiAliasingThreshold</key> | |
<integer>1</integer> | |
<key>ApplePressAndHoldEnabled</key> | |
<false/> | |
<key>AppleScrollAnimationEnabled</key> | |
<integer>0</integer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read the full article on https://softwareadept.xyz/2020/06/deploying-hugo-with-gitlab-ci/ | |
stages: | |
- build | |
- deploy | |
build: | |
stage: build | |
image: registry.gitlab.com/pages/hugo:latest | |
script: | |
- hugo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import uuid | |
tmp = '/tmp/{}'.format(uuid.uuid4()) | |
files_root = os.getcwd() | |
for root, dirs, files in os.walk(files_root): | |
root_path = root.replace(files_root, '') | |
root_path = root_path[1:] if root_path.startswith('/') else root_path | |
for file in files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Install Docker | |
hosts: all | |
become: yes | |
tasks: | |
- name: Install Docker dependencies | |
apt: | |
pkg: | |
- apt-transport-https | |
- ca-certificates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
from pathlib import Path | |
from functools import wraps | |
""" | |
This is a dummy implementation of the privilege-based checks based on the following article: | |
https://lostechies.com/derickbailey/2011/05/24/dont-do-role-based-authorization-checks-do-activity-based-checks/ | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import BaseHTTPServer | |
import cgi | |
from pprint import pformat | |
PORT = 6969 | |
FILE_TO_SERVE = 'path/to/your/response/content.json' | |
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Very simple HTTP server in python for logging requests | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import logging | |
class S(BaseHTTPRequestHandler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
HOST_NAME = 'localhost' | |
PORT_NUMBER = 9000 | |
class MyHandler(BaseHTTPRequestHandler): | |
def do_HEAD(self): | |
self.send_response(200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fail2Ban configuration file | |
# | |
# NOTE | |
# You should set up in the jail.conf file, the maxretry and findtime carefully in order to avoid false positives. | |
# | |
# Author: http://www.go2linux.org | |
# Modified by: samnicholls.net | |
# * Mon 6 Jun 2016 - Updated failregex to capture HOST group correctly | |
[Definition] |
NewerOlder