Skip to content

Instantly share code, notes, and snippets.

View flexd's full-sized avatar

Kristoffer Berdal flexd

View GitHub Profile
@scjudd
scjudd / Auth.elm
Last active December 1, 2019 16:36
Authentication in Elm
module Auth exposing (User(..), UserInfo, LoginInfo, loginTask)
import HttpBuilder exposing (..)
import Json.Encode as Encode
import Json.Decode as Decode exposing ((:=))
import Task exposing (Task)
type User
= Authenticated UserInfo
@asfaltboy
asfaltboy / Instructions.md
Last active October 26, 2017 10:00
Log all cronjob output to syslog and send errors to sentry

Log cronjob output to syslog and send errors to sentry

The wonderful [cron-sentry][1] takes care of sending an event for program errors to sentry. To uniformy log everything outputted, we pipe both stderr and stdout to [logger][2] (should be available on most linux distros)

How to use

Download script, add execution perm and move to a directory on PATH

$ wget https://gist.githubusercontent.com/asfaltboy/23a7f963bbfcb48ce510307ec8cb8737/raw/49ebca20004211a16c85a61a77db7d0883ddf31c/log-and-sentry

$ chmod +x log-and-sentry

@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active July 14, 2024 19:55
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@tuxfight3r
tuxfight3r / ipxe_with_dhcp.txt
Last active October 25, 2023 03:34
ipxe kickstart over http - dhcp and static configuration
#clone the repo
git clone http://git.ipxe.org/ipxe.git
cd ipxe/src
cat >ubuntu-amd64-installer.ipxe <<EOF
#!ipxe
dhcp
echo Starting Ubuntu x64 installer for ${hostname}
set base-url http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
@lacymorrow
lacymorrow / setup.md
Last active November 17, 2017 09:21 — forked from lazd/Sony Super HAD HS1177 Camera Setup.md
HS1177 Sony Super HAD Camera Setup.md

Cam settings

Before you do anything, perform a factory reset.

##Exposure

Shutter: Auto

Brightness: 55

@flexd
flexd / zfs_health.sh
Last active January 22, 2016 09:55
zfs_health.sh script taken from https://calomel.org/zfs_health_check_script.html and updated with the ZFSOnLinux Date format I got on my Debian Jessie machine
#! /bin/sh
#
# Calomel.org
# https://calomel.org/zfs_health_check_script.html
# FreeBSD ZFS Health Check script
# zfs_health.sh @ Version 0.17
# Check health of ZFS volumes and drives. On any faults send email.
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active April 21, 2024 23:48
An Open Letter to Developers Everywhere (About Cryptography)
@eoftedal
eoftedal / Dockerfile
Last active November 19, 2015 12:05
Dockerfile for BeEF
FROM ubuntu
RUN apt-get update && apt-get upgrade -y && apt-get install -y build-essential libsqlite3-dev sqlite3 libssl-dev curl
RUN apt-get install -y software-properties-common && \
apt-add-repository -y ppa:brightbox/ruby-ng && \
apt-get update && \
apt-get install -y ruby2.1 ruby2.1-dev
WORKDIR /opt/
RUN locale-gen en_US.UTF-8
ENV LC_ALL en_US.UTF-8
RUN curl https://codeload.github.com/beefproject/beef/tar.gz/beef-0.4.6.1 -o beef-0.4.6.1.tar.gz && \
@namsral
namsral / ziphttpd.go
Last active October 16, 2017 10:32
Deploy and serve assets from a zip archive
package main
import (
"archive/zip"
"flag"
"log"
"net/http"
"golang.org/x/tools/godoc/vfs/httpfs"
"golang.org/x/tools/godoc/vfs/zipfs"
@limingjie
limingjie / 256 colors.md
Last active June 28, 2024 07:21
256 colors in putty, tmux/screen and vim

#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.

  • putty

    Set Connection -> Data -> Terminal-type string to xterm-256color

  • tmux

Add this line to ~/.tmux.conf