Skip to content

Instantly share code, notes, and snippets.

View andrewp-as-is's full-sized avatar
🔍

Andrew P andrewp-as-is

🔍
View GitHub Profile
@andrewp-as-is
andrewp-as-is / Dockerfile
Created January 16, 2024 08:18
Docker alpine pycurl
FROM python:3.7-alpine
RUN apk add --no-cache libcurl
ENV PYCURL_SSL_LIBRARY=openssl
RUN apk add --no-cache --virtual .build-deps build-base curl-dev \
&& pip install pycurl \
&& apk del --no-cache --purge .build-deps \
&& rm -rf /var/cache/apk/*
text body
@andrewp-as-is
andrewp-as-is / Launchctl_Unload-10.14.sh
Created August 1, 2023 12:41 — forked from mmillar-bolis/Launchctl_Unload-10.14.sh
A Quick Little Script to Force Disable Certain LaunchDaemons in macOS
#!/bin/bash
# I have managed to map out some undesirable daemons and agents. Most of these
# can be disabled without too much consequence.
## Daemons
# com.apple.analyticsd - Anonymized application analytics daemon
# com.apple.appleseed.fbahelperd - Feedback Assistant Helper Daemon
# com.apple.awacsd - Apple Wide Area Connectivity Service Daemon
# com.apple.backupd - Apple TimeMachine service
@andrewp-as-is
andrewp-as-is / docker-stop-all-containers.sh
Last active October 12, 2021 19:45
Docker stop all containers #docker
sudo docker ps -q | xargs -r sudo docker stop
@andrewp-as-is
andrewp-as-is / macOS-list-ports.sh
Last active March 18, 2024 19:14
macOS list ports #macos
#!/usr/bin/env bash
PORT=8013
lsof -nP -iTCP:$PORT | grep LISTEN;:
@andrewp-as-is
andrewp-as-is / gunicorn-kill-processes.sh
Created June 17, 2020 13:16
gunicorn kill processes
#!/usr/bin/env bash
ps aux | grep gunicorn | awk '{print $2;}' | xargs kill -9 2>/dev/null
ps aux | grep gunicorn | awk '{print $2;}' | xargs kill -9 2>/dev/null
ps aux | grep gunicorn | awk '{print $2;}' | xargs kill -9 2>/dev/null
ps aux | grep python | awk '{print $2;}' | xargs kill -9 2>/dev/null
@andrewp-as-is
andrewp-as-is / certbot.sh
Last active June 17, 2020 13:19
certbot
sudo certbot --nginx certonly -d domain.com,www.domain.com --expand
@andrewp-as-is
andrewp-as-is / user.sql
Created June 17, 2020 13:16
PostgreSQL user
--sudo -u postgres psql -p 5432
CREATE USER username WITH PASSWORD 'secret';
ALTER USER username WITH PASSWORD 'secret';
DROP USER username;
CREATE DATABASE dbname WITH OWNER=username;
GRANT ALL PRIVILEGES ON DATABASE "dbname" to username;
@andrewp-as-is
andrewp-as-is / postgres-status.sh
Created June 17, 2020 13:16
PostgreSQL status
service postgresql status | tee
sudo pg_lsclusters
ps -ax | grep -v grep | grep postgres
sudo netstat -tulpn | grep :543
@andrewp-as-is
andrewp-as-is / Makefile
Last active June 17, 2020 13:19
PostgreSQL ssh
SSH_HOSTNAME:=ubuntu@github42
NAME:=github42
VERSION:=12
all:
make sync
make restart
make status
sync: