Skip to content

Instantly share code, notes, and snippets.

Avatar
👋
Click here to edit status

Philipp Defner dewey

👋
Click here to edit status
View GitHub Profile
View Dockerfile
FROM ruby:2.7-alpine AS build-env
ARG RAILS_ROOT=/app
ARG BUILD_PACKAGES="build-base curl-dev git"
ARG DEV_PACKAGES="postgresql-dev yaml-dev zlib-dev nodejs yarn"
ARG RUBY_PACKAGES="tzdata"
ENV RAILS_ENV=production
ENV NODE_ENV=production
ENV BUNDLE_APP_CONFIG="$RAILS_ROOT/.bundle"
WORKDIR $RAILS_ROOT
@dewey
dewey / cloudSettings
Created Aug 24, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-08-24T14:30:14.047Z","extensionVersion":"v3.0.0"}
@dewey
dewey / mail.md
Last active Aug 14, 2018
Gitlab Vulnerability Spam
View mail.md

Update: Seems to be real https://news.ycombinator.com/item?id=11587416

Original Message:

I received this message on Wednesday, April 27, 2016 7:35 PM. Couldn't find anything about it on Gitlab's Blog or Twitter so I asked for clarification here: https://twitter.com/tehwey/status/725612585886842880

Anyone else got one of these, maybe to an address that's exclusively used on Gitlab? There also seems to be a huge spam issue going on in their issue tracker right now:

https://gitlab.com/gitlab-org/gitlab-ce/issues?page=5&scope=all&sort=id_desc&state=opened

@dewey
dewey / gist:4c1c8cf7d289e5c3437b6bc6b92e8698
Created Apr 9, 2016
Kernel flags for Docker on Gentoo
View gist:4c1c8cf7d289e5c3437b6bc6b92e8698
* CONFIG_CGROUP_HUGETLB: is not set when it should be.
* CONFIG_NET_CLS_CGROUP: is not set when it should be.
* CONFIG_RT_GROUP_SCHED: is not set when it should be.
* CONFIG_CGROUP_NET_PRIO: is not set when it should be.
* CONFIG_DEVPTS_MULTIPLE_INSTANCES: is not set when it should be.
* CONFIG_CGROUP_DEVICE: is not set when it should be.
* CONFIG_CGROUP_FREEZER: is not set when it should be.
* CONFIG_CGROUP_SCHED: is not set when it should be.
* CONFIG_NF_NAT_IPV4: is not set when it should be.
@dewey
dewey / main.go
Last active Dec 2, 2015
Parse multiple .ics feeds into one and create the file and serve it via http.
View main.go
package main
import (
"bufio"
"crypto/md5"
"encoding/hex"
"fmt"
"log"
"net/http"
"os"
View gist:f2725f51857607e52093
#!/usr/bin/env python
import urllib.request
import json
import sys
def main():
try:
mode = sys.argv[1]
except IndexError:
mode = ""
View tupel.js
var input = ['p1', 'p2', 'p3', 'p4', 'p5', 'p6']
var output = [];
var counter = 0;
for(var i = 0; i <= input.length-1; i++) {
var tupel = [];
if(counter == 0) {
tupel.push(input[i])
counter++;
@dewey
dewey / updatecheck.sh
Created Dec 6, 2014
Shell script to send push notifications if there are new Gentoo updates available.
View updatecheck.sh
#!/bin/zsh
updates=`emerge -pv --color n --update --deep --newuse world`
if [ "`echo $updates | wc -l`" -gt "6" ]; then
message=`echo $updates | grep -F --color=never "ebuild"`
curl -s \
--form-string "token=APP TOKEN HERE" \
--form-string "user=USER TOKEN HERE" \
--form-string "title=Updates available for: `hostname`" \
--form-string "message=$message" \
https://api.pushover.net/1/messages.json
@dewey
dewey / app.js
Created Nov 6, 2014
Script to calculate the total size of data listed in all torrent files in a given directory
View app.js
// Script to calculate the total size of data listed in all torrent files in a given directory.
//
// Dependencies: Install `parse-torrent-file` and `glob` with `npm install`. `fs` is already a core library.
// Usage: Move all directories containing *.torrent files into the torrent/ directory
// and run `node app.js`.
//
// Author: https://github.com/dewey - 6.11.2014
var parseTorrentFile = require('parse-torrent-file'),
fs = require('fs'),
@dewey
dewey / gist:214b9ec50c71223da356
Created Nov 6, 2014
SCP Torrent from directory containing a bunch of torrents to watch directory every 5 seconds and then delete it.
View gist:214b9ec50c71223da356
for f in torrents/*; do scp "$f" torrent@example.com:~/rtorrent/watch/watchWHAT/ && rm "$f" ; sleep 5; done