Skip to content

Instantly share code, notes, and snippets.

Avatar
🎩
This is the year of ipv6 and python3!

Felix fliiiix

🎩
This is the year of ipv6 and python3!
View GitHub Profile
View vec_demo.rs
#[derive(Debug)]
struct Attribute<'a> {
name: &'a str,
url: &'a str,
}
fn main() {
let attributes = vec![
Attribute {
name: "Batman",
@soheilhy
soheilhy / nginxproxy.md
Last active Nov 16, 2022
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@fdelbos
fdelbos / FreeBSD_node_monit.md
Last active Feb 17, 2020
FreeBSD 10 Nodejs setup with nginx, mongo and monit
View FreeBSD_node_monit.md

FreeBSD 10 Nodejs setup with nginx, mongodb, redis and monit

This my receipe for installing a complete nodejs server on FreeBSD 10. The parameters used in this configuration are for a very small private server that I use for demo purpose only, so for a production server, you should somehow set the limits in pair with your ressources.

I use monit so I don't have to write rc scripts for node and it should take care of process lifecycle management for me. Alternatives exists such as supervisord or circus.

Installing mongodb

@optikfluffel
optikfluffel / kitty.zsh
Created Feb 2, 2014
zsh function to download an image from placekitten.com
View kitty.zsh
kitty() { command wget -O kitty.jpg http://placekitten.com/"$2"/"$3" }
@stephsharp
stephsharp / README.md
Last active Oct 22, 2020
Stack Overflow user profile Dashing widget
View README.md

Badge Overflow

An exceptionally handsome way to track your Stack Overflow badges.
Note: Badge Overflow now works with all Stack Exchange sites.

Created by Adam & Stephanie Sharp.

User Profile widget

A Dashing widget that

View That’s Cool
Heh
Anyway
Obviously it's not a huge deal
It just makes me sad
I like Node
And I can write Node
I just don't use it for anything
I like JS
And I can write JS
I just prefer CoffeeScript for day to day use
@runlevel5
runlevel5 / puma.sh
Last active Jul 18, 2022
pumactl is very broken, @nemshilov and @joneslee85 wrote this bash script replacement and it works so reliably on production server. So here it is, share with the world!
View puma.sh
#!/usr/bin/env bash
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`.
# Please modify the CONSTANT variables to fit your configurations.
# The script will start with config set by $PUMA_CONFIG_FILE by default
PUMA_CONFIG_FILE=config/puma.rb
PUMA_PID_FILE=tmp/pids/puma.pid
PUMA_SOCKET=tmp/sockets/puma.sock
@spikegrobstein
spikegrobstein / nginx.conf
Last active Aug 25, 2022
nginx config for proxying requests for plex over a hostname-based virtualhost.
View nginx.conf
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
server plex-server.example.com:32400;
}
server {
listen 80;
# server names for this server.
@jbtule
jbtule / AESGCM.cs
Last active Sep 23, 2022
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
View AESGCM.cs
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;
@troelskn
troelskn / app.rb
Last active Aug 12, 2021 — forked from dstrelau/app.rb
Gollum protected by HTTP Basic
View app.rb
require 'gollum/frontend/app'
require 'digest/sha1'
class App < Precious::App
User = Struct.new(:name, :email, :password_hash, :can_write)
before { authenticate! }
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end
helpers do