Skip to content

Instantly share code, notes, and snippets.

@vaskozl
vaskozl / nsenter-talos.sh
Created April 30, 2024 22:12
Talos Root Shell for debugging
#!/bin/sh
set -x
node=${1}
#nodeName=$(kubectl get node ${node} -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}')
nodeSelector='"nodeSelector": { "kubernetes.io/hostname": "'${node:?}'" },'
podName=${USER}-nsenter-${node}
kubectl -n kube-system run ${podName:?} --restart=Never -it --rm --image overriden --overrides '
{
"spec": {
@aberonni
aberonni / git-bisect.md
Created May 1, 2024 07:00
Performing a git bisect

git bisect is a really useful tool when you want to answer the question "when did this thing change?" but it's hard to understand from just looking at the git logs.

The way git bisect works is that you define a "good" and a "bad" commit. The git bisect command then uses a binary search to narrow down the commit that made the repository go from "good" to "bad".

You can further make your life easier by asking git bisect to execute a script for you on each commit, automating the search, and providing the commit in question with no further manual intervention.

Below is an example, with an example script, that illustrates how git-bisect was used on the 121-platform to find the answer to the question "when did typeorm start generating nonsense migrations?".

Setup

@matt-e-king
matt-e-king / gist:3ac2127025cf5dbc03001d9b21c1984a
Created April 17, 2024 19:06
Hypothesis Embed and sock in Vue app
// HypothesisEmbed.vue
// This is the component that mounts on the page that has the annotations
// It's important to destroy the client when componenent is unmounted
// because if the component remounts, it creates duplicate annotations in the DOM
<template>
<div
id="HypothesisEmbed"
class="HypothesisEmbed"
/>
@braingineer
braingineer / matprint.py
Created March 8, 2017 01:31 — forked from lbn/matprint.py
Pretty print a matrix in Python 3 with numpy
def matprint(mat, fmt="g"):
col_maxes = [max([len(("{:"+fmt+"}").format(x)) for x in col]) for col in mat.T]
for x in mat:
for i, y in enumerate(x):
print(("{:"+str(col_maxes[i])+fmt+"}").format(y), end=" ")
print("")
# Try it!
import numpy as np
@dewomser
dewomser / toot_a_photostream.sh
Last active May 1, 2024 06:55
mastodon toot a photostream make and destroy toots in a time intervall
!/bin/bash
#crontab
#for crontab use always full path or EXPORT
#crontabline : */15 * * * * /full/path/toot_a_photostream.sh >/full/path/error.txt 2>&1
fullpath_dir="/home/foo/bin/stream"
fullpath_toot="/usr/bin/toot"
source_url="https://webcams.lolo.de/Webcam1/webcam/current.jpg"
toottext="your txt $(date +%H:%M) . Every 15 minutes a snapshot!"
tootid="$(cat $fullpath_dir/toot_id.txt)"
@Kishoreganjpost
Kishoreganjpost / কিশোরগঞ্জ পোস্ট
Created May 1, 2024 06:53
KISHOREGANJ POST IS A NEWSPAPER PUBLISHER. HACKER HACKED BY THE SITE. PLEASE HELP ME?
Control+Shift+m tab
https://Kishoreganjpost.com
@espdev
espdev / qtabwidget.css
Last active May 1, 2024 06:52
A QTabWidget Custom Stylesheet Example
QTabWidget::pane {
border: 1px solid black;
background: white;
}
QTabWidget::tab-bar:top {
top: 1px;
}
QTabWidget::tab-bar:bottom {
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 1, 2024 06:45
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@mdoyle13
mdoyle13 / Dockerfile
Created May 4, 2020 18:48
Rails 6, ruby 2.7 Docker for Development
FROM ruby:2.7
RUN apt-get update && apt-get install -y \
curl \
build-essential \
libpq-dev &&\
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y nodejs yarn vim
@file:OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
package de.kuno.listsections
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateRectAsState
import androidx.compose.foundation.ExperimentalFoundationApi