Skip to content

Instantly share code, notes, and snippets.

View TheBigAleski's full-sized avatar
🐻
hibernating on 🍻

Alex LEGROS TheBigAleski

🐻
hibernating on 🍻
  • Sogeti, part of Capgemini
  • Rennes, FRANCE
  • 11:23 (UTC +02:00)
  • LinkedIn in/alexislegros
View GitHub Profile
@TheBigAleski
TheBigAleski / gke-downscaling.js
Last active November 25, 2024 08:18
HTTPS Google Cloud Run function that removes auto-scaling and reduces node groups size for all GKE found in project (projectId passed either in query or body)
const functions = require('@google-cloud/functions-framework');
const container = require('@google-cloud/container');
functions.http('helloHttp', async(req, res) => {
const client = new container.v1.ClusterManagerClient();
projectId = req.query.projectId || req.body.projectId;
const request = {
@TheBigAleski
TheBigAleski / bash-init.sh
Last active January 19, 2023 10:12
Bash init
# Git aliases
git config --global alias.lol 'log --pretty="format:%C(auto,yellow)%h %C(auto,cyan)%>(12,trunc)%ar %C(auto,green)%aN %C(auto,reset)%s%C(auto,red)% gD% D" -n25'
git config --global alias.st status
git config --global alias.brhist 'branch -a --sort=-committerdate --format="%(HEAD) %(color:red)%(refname:short)%(color:reset) - %(color:yellow)%(objectname:short)%(color:reset) - %(contents:subject) - %(color:green)%(authorname)%(color:reset) (%(color:cyan)%(committerdate:relative)%(color:reset))"'
git config --global core.editor 'code --wait'
@TheBigAleski
TheBigAleski / ManifestToJson.java
Last active March 21, 2018 13:54
Manifest to JSONObject
JSONObject json = new JSONObject();
Manifest mf = new Manifest();
mf.read(Thread.currentThread().getContextClassLoader().getResourceAsStream("META-INF/MANIFEST.MF"));
for (Map.Entry<Object, Object> entry:mf.getMainAttributes().entrySet()) {
json.put(entry.getKey().toString(), entry.getValue());
}