Skip to content

Instantly share code, notes, and snippets.

View rt1d6m7's full-sized avatar
👽
THE ALL is Mind; The Universe is Mental

Rijo Thomas rt1d6m7

👽
THE ALL is Mind; The Universe is Mental
View GitHub Profile
@rt1d6m7
rt1d6m7 / docker-compose.yml
Created May 11, 2023 12:04 — forked from nicoavila/docker-compose.yml
Docker Compose file for a MySQL 5.7 container
version: '3.3'
services:
database:
image: mysql:5.7
container_name: mysql
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'

Kubectl plugin

This plugin adds completion for the Kubernetes cluster manager, as well as some aliases for common kubectl commands.

To use it, add kubectl to the plugins array in your zshrc file:

plugins=(... kubectl)
@rt1d6m7
rt1d6m7 / postgres_queries_and_commands.sql
Created November 23, 2020 06:27 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
import os
import time
def measure_temp():
temp = os.popen("vcgencmd measure_temp").readline()
return (temp.replace("temp=",""))
while True:
print(measure_temp())
time.sleep(1)
#!/bin/bash
# variables
LOGFILE="/var/log/nginx/access.log"
LOGFILE_GZ="/var/log/nginx/access.log.*"
RESPONSE_CODE="200"
# functions
filters(){
grep $RESPONSE_CODE \
@rt1d6m7
rt1d6m7 / gist:f6843dd6ae574e05971ce3195a400c25
Created October 28, 2017 15:20 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>