Skip to content

Instantly share code, notes, and snippets.

View pcnoic's full-sized avatar
🌍
Working from planet earth

Christos Alexiou pcnoic

🌍
Working from planet earth
View GitHub Profile
@pcnoic
pcnoic / get_kubeconfigs.sh
Created August 26, 2024 09:01
Generate K8S configs for all GKE clusters under a GCP Project
#!/bin/bash
if ! command -v gcloud &> /dev/null
then
echo "gcloud could not be found. Please install the Google Cloud SDK."
exit 1
fi
if ! command -v kubectl &> /dev/null
then
@pcnoic
pcnoic / .zshrc
Created March 12, 2024 12:30
.zshrc config
DEFAULT_USER="$(whoami)"
export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"
export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"
# Aliases
@pcnoic
pcnoic / profile.xml
Last active April 6, 2023 11:46
java formatting settings xml
<code_scheme name="Clutch code style" version="173">
<option name="AUTODETECT_INDENTS" value="false" />
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</value>
</option>
<option name="FORMATTER_TAGS_ENABLED" value="true" />
<DB2CodeStyleSettings version="5">
@pcnoic
pcnoic / languages.js
Last active July 23, 2022 23:46
BCP47 language list for JS
const data = [{ "af-ZA": "Afrikaans (South Africa)" },
{ "en-NR": "English (Nauru)" },
{ "fr-RE": "French (Réunion)" },
{ "ar-AE": "Arabic (United Arab Emirates)" },
{ "en-NU": "English (Niue)" },
{ "fr-RW": "French (Rwanda)" },
{ "ar-AR": "Arabic (Arabic)" },
{ "en-NZ": "English (New Zealand)" },
{ "fr-SC": "French (Seychelles)" },
{ "ar-BH": "Arabic (Bahrain)" },
@pcnoic
pcnoic / karabiner.json
Last active March 29, 2023 17:41
karabiner exported config - mac to pc style shortcuts
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
@pcnoic
pcnoic / syntropy-agent.yaml
Last active February 8, 2022 18:10
Ansible Playbook to install Syntropy Agent
---
- name: install syntropy agent
hosts: all
# tasks file for syntropy-agent
tasks:
- name: pull an image
docker_image:
name: syntropynet/agent:stable
- name: Stop and remove old container
@pcnoic
pcnoic / config.json
Last active October 29, 2023 21:08
VSCode Keybindings for using a Windows/Linux layout on macOS (provided that you have karabiner pc-style keymap enabled)
// User keybindings.json and use this https://marketplace.visualstudio.com/items?itemName=smcpeak.default-keys-windows
[
{
"key": "ctrl+shift+p",
"command": "workbench.action.quickOpenNavigatePreviousInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
{
"key": "shift+cmd+p",
"command": "-workbench.action.quickOpenNavigatePreviousInFilePicker",
@pcnoic
pcnoic / spa-nginx.conf
Last active June 27, 2022 18:54
SPA NGINX config podhustlr
server {
listen 80;
server_name localhost;
port_in_redirect off;
autoindex on;
location / {
root /spa;
index index.html index.htm;
# kill cache
@pcnoic
pcnoic / Fix-MacOS-Keyboard-to-Behave-Properly-For-A-Linux-User.txt
Created November 10, 2021 20:50
Get a Mac keyboard to work like a typical Unix keymap
- Setup Spotlight to open with Option/Alt + Space
- Setup Switch Input to open with Command + Space
- Setup Karabiner and use typical PC keymap
- Make From Key -> Fn / To Key -> Left Ctrl
- Install smcpeak Windows Keymap in Vscode
@pcnoic
pcnoic / cleaner.py
Created October 3, 2021 15:58
Delete files older than 3 months by parsing dates in filename
#!/usr/bin/env python3
# Simple script to delete files older than 3 months.
# Usage: ./clean.py <path-of-dir-to-clean>
import os
import sys
import re
import datetime
from datetime import datetime as dt