Skip to content

Instantly share code, notes, and snippets.

@amd64bit
amd64bit / curl.md
Created October 3, 2018 08:51 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@amd64bit
amd64bit / supervisord.conf
Created September 12, 2018 07:20 — forked from dkarchmer/supervisord.conf
Sample supervisord conf for running a python script in the background
; Assumes dockerfile with:
; ENTRYPOINT ["/usr/bin/supervisord", "-c", "/var/app/supervisord.conf"]
[supervisord]
;logfile=/var/app/logs/ ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=5 ; (num of main logfile rotation backups;default 10)
loglevel=debug ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=true ; (start in foreground if true;default false)
@amd64bit
amd64bit / ddns_update
Created August 23, 2018 07:17 — forked from adrianmo/ddns_update
Mikrotik script to update a dynamic DNS host and IPsec policy
##############Script Settings##################
:local DDNSUser "username"
:local DDNSPass "password"
:local DDNSDomain "yourhost.ddns.net"
:local DDNSServer "https://members.dyndns.org/v3/update"
:local WANInter "pppoe-out1"
###############################################
:local IpCurrent [/ip address get [find interface=$WANInter] address];
:for i from=( [:len $IpCurrent] - 1) to=0 do={

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
#!/bin/sh
echo "==== Disable SELinux ===="
setenforce 0
sed -i "s/^SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
echo "==== Start Yum Update ===="
yum -y update
echo "==== Install nano and wget ===="
@amd64bit
amd64bit / udpclient.py
Created April 20, 2018 04:34 — forked from glegoux/udpclient.py
[Python] Run UDP client for UDP socket server
#!/usr/bin/env python3
#
# udpclient.py
#
# Required that UDP server runs on 127.0.0.1 port 8000.
# See Gist udpserver.py.
#
# Send UDP message to UDP server.
#
# usage: python3 udpclient.py
@amd64bit
amd64bit / udpserver.py
Created April 20, 2018 04:32 — forked from glegoux/udpserver.py
[Pyhton] Run UDP server via socket server
#!/usr/bin/env python3
#
# udpserver.py
#
# See Gist udpclient.py to send a UDP message.
#
# Run UDP server on 127.0.0.1 port 8000.
#
# usage: python3 udpserver.py
@amd64bit
amd64bit / MQTTWemosButton.ino
Created November 21, 2017 14:55 — forked from jpwsutton/MQTTWemosButton.ino
MQTT Wemos Button
/***************************************************
MQTT Button on Wemos
James Sutton 2017 - jsutton.co.uk
****************************************************/
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
/************************* WiFi Access Point *********************************/
@amd64bit
amd64bit / CentOS_7.2_New_WebServer_Configuration.txt
Created December 13, 2016 09:26 — forked from alkavan/CentOS_7.x_(PHP_7.3_Postgres_10.x).md
CentOS 7.2 New Web Server Configuration (DigitalOcean) +EPEL +IUS +PHP +MongoDB +Sentry +PostgreSQL +MariaDB
# [General/Initial Section]
# Update system
yum update
# Set your timezone
timedatectl set-timezone UTC
# Check date is set correct
date
"""
Fade IN/OUT some text..
"""
import sys
import time
import pygame
## Show some text fade in/out