Skip to content

Instantly share code, notes, and snippets.

View ArgonQQ's full-sized avatar
🚀
Mars is there, waiting to be reached.

Marcel Sinn ArgonQQ

🚀
Mars is there, waiting to be reached.
View GitHub Profile
@ArgonQQ
ArgonQQ / README.md
Last active March 3, 2023 02:06
Brew install specific version / Locally freeze version

Brew install specific version / Locally freeze version

# Please define variables
packageName=<packageName>
packageVersion=<packageVersion>

# Create a new tab
brew tap-new local/$packageName
@ArgonQQ
ArgonQQ / update_git_repos.sh
Last active June 10, 2021 03:19 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# exclude list - pipe sepearted e.g. ".terraform|test|foldername"
EXCLUDE=".terraform"
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
@ArgonQQ
ArgonQQ / Postgres-Cheatsheet.md
Created January 19, 2018 08:27
Postgres Cheatsheet

Postgres Cheatsheet

Dump all PostgreSQL Databases

pg_dumpall | gzip -c > /path/to/backup/$(date +'%Y-%m-%d-%H-%M')-db.dump.gz

Reimport all PostgreSQL Databases

psql -f postgres

@ArgonQQ
ArgonQQ / ansible.yml
Created January 10, 2018 09:39 — forked from jgornick/ansible.yml
Ansible: Remove All Files Except
---
- name: Capture files in path and register
shell: >
ls -1 /path/to/files
register: files
- name: Remove files except specified
file:
path: "/path/to/files/{{ item }}"
state: absent
@ArgonQQ
ArgonQQ / KubernetesCheatsheet.md
Last active October 22, 2022 03:30
🐳 Kubernetes Cheatsheet 🐳

General

Namespace

For every command you enter with kubectl (if you have enough permissions) you can alternatively specify the namespace --namespace=default

Default Service/ Namespace Syntax

<service>.<namespace>.svc.cluster.local

Get Node ips & names

kubectl get nodes -o json | grep "\"address\": \"" | uniq | sort | awk '{print $2}'

Scale Deployments

### SUPERVISORD ###
RUN \
apt-get update && \
apt install -y \
supervisor &&\
mkdir -p /var/log/supervisor && \
mkdir -p /etc/supervisor/conf.d
ADD supervisor.conf /etc/supervisor.conf
### SUPERVISORD ###

bash-hacker

I wrote this script to keep a file or a folder in sync local or remotely. This worked out very well to sync changes in the code to a remote server in seconds without touching any button on my keyboard. The method to check if anything has changed is even simpler. It checks the file or folder last change date 'ls --full-time'.

Set the variable path to a directory or file. This could be a remote path aswell.

FP_rsync_from='/folder/from'
FP_rsync_to='/folder/to'
# Switch User
su -
#General informations
printf "\nHostname: \n" && hostname && ip a s |grep "inet "
#Install Packages
apt install -y bash-completion vim curl wget git
#LAMP
@ArgonQQ
ArgonQQ / Docker-Cheatsheet.md
Last active September 24, 2019 11:12
🐳 Docker Cheatsheet 🐳

eval will set the variable to use Docker without the need to start "Docker Quickstart Terminal" eval takes a string as its argument, and evaluates it as if you'd typed that string on a command line. (If you pass several arguments, they are first joined with spaces between them.) eval $(docker-machine env)

Stop all docker container

docker stop $(docker ps -a -q)

Delete all docker container

docker rm $(docker ps -a -q)

@ArgonQQ
ArgonQQ / owncloud-docker-compose.yml
Created April 14, 2016 15:22 — forked from MickaelBergem/ owncloud-docker-compose.yml
Docker Compose file for setting up an ownCloud server using a PostgreSQL database
# Composition of the containers
owncloud:
image: owncloud
ports:
- 80:80
volumes_from:
- owncloud-data
links:
- postgres:owncloud-db