Skip to content

Instantly share code, notes, and snippets.

@linuxmalaysia
linuxmalaysia / README-autossh-systemd.txt
Last active April 3, 2024 16:33
Autossh using systemd
1) ==== Autossh using systemd ====
Example from
https://gist.github.com/drmalex07/c0f9304deea566842490
2) =============
Install autossh
@mdonkers
mdonkers / server.py
Last active April 30, 2024 23:26
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@KarthikNayak
KarthikNayak / a.md
Last active August 19, 2023 16:14
Installing Arch with LVM
@AlexeyDemidov
AlexeyDemidov / defaults_unicorn_app
Last active March 24, 2021 07:34
Unicorn service file for systemd with rvm support
# save this file in /etc/default/unicorn_app
USER=app_user
APP_ROOT=/srv/app
RVM_STRING=2.2.4@app_gemset
RACK_ENV=production
UNICORN_OPTS="-D -c /srv/app/shared/config/unicorn.rb -E production"
DAEMON=unicorn
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active April 30, 2024 01:32
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@xrstf
xrstf / letsencrypt.md
Last active April 18, 2023 05:01
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@ChuckJHardy
ChuckJHardy / digital_ocean_setup.md
Last active October 27, 2023 17:51
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@dustin
dustin / Dockerfile
Last active February 7, 2021 17:07
How I built couchbase 2.2 for docker
FROM ubuntu
MAINTAINER Dustin Sallings "dustin@spy.net"
ADD http://cbfs-ext.hq.couchbase.com/couchbase-dist/couchbase-server-enterprise_2.2.0_x86_64.deb /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN apt-get update
RUN apt-get install -y librtmp0 python-httplib2
RUN dpkg -i /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN rm /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN /etc/init.d/couchbase-server stop
upstream some_app_server {
server 127.0.0.1:9393;
}
server {
listen 80;
server_name my-upload-endpoint.com ;
user = ""
pwd = ""
url = 'https://yourstore.com/'
login_url = "#{url}login.asp"
product_url = "#{url}admin/AdminDetails_Generic.asp?table=Products_Joined&ID="
agent = Mechanize.new
page = agent.get(login_url)
login_form = page.form('loginform')