Skip to content

Instantly share code, notes, and snippets.

View sophieforceno's full-sized avatar

sophiejane sophieforceno

  • Connecticut, USA
View GitHub Profile
@alghanmi
alghanmi / lighttpd.default.conf
Last active March 2, 2022 19:21
Lighttpd Default Configuration File
server.port = 80
#server.bind = ""
server.tag ="lighttpd"
server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_compress",
"mod_expire",
@joemiller
joemiller / netpps.sh
Last active January 12, 2024 15:39
shell: quick linux scripts for showing network bandwidth or packets-per-second
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
@jbq
jbq / uwsgi-watch-wc
Last active April 4, 2019 11:21
Python script using pyinotify to detect changes in a working copy, and notify UWSGI to reload app. To be used along with UWSGI's "attach-daemon" option.
#! /usr/bin/python
import pyinotify, sys, os, signal, threading, time, syslog
lastEventTime = None
def iswatched(path):
return (path.endswith(".tmpl") or path.endswith(".py"))
def callback(evt):
@bitmorse
bitmorse / lastexport.py
Created March 20, 2013 00:51
lastfm scrobble exporter (from https://gitorious.org/fmthings/lasttolibre/blobs/master/lastexport.py // changed the script to try more often on failure )
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@XVilka
XVilka / TrueColour.md
Last active July 9, 2024 23:28
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

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

@bionik
bionik / gist:483b4b144da5cb54606b
Last active March 29, 2016 16:32
Slim down Ubuntu server dynamic motd
The dynamic motd shows a bit too much info by default:
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-45-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Thu Feb 12 22:05:52 EET 2015
System load: 0.01 Processes: 153
Usage of /home: 11.8% of 274.89GB Users logged in: 0
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active July 7, 2024 19:47
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active July 19, 2024 22:35
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@Tristor
Tristor / iptables.sh
Last active December 22, 2023 20:19
Simple IPtables script for an OpenVPN server
#!/bin/bash
# Flushing all rules
iptables -F FORWARD
iptables -F INPUT
iptables -F OUTPUT
iptables -X
# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP