Skip to content

Instantly share code, notes, and snippets.

View gamanakis's full-sized avatar

George Amanakis gamanakis

  • Hannover, Germany
View GitHub Profile
@gamanakis
gamanakis / pass.md
Created March 30, 2023 11:53 — forked from abtrout/pass.md
Using password-store with git repository synching

Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store. For more information about GPG, consult the GNU Privacy Handbook.

Getting started

To get started, install pass and generate a keypair.

$ brew install pass
$ gpg --gen-key
$ gpg --list-keys
@gamanakis
gamanakis / Gradient_Accumulation_TF2.py
Created March 3, 2022 13:50 — forked from innat/Gradient_Accumulation_TF2.py
Gradient Accumulation with Custom fit in TF.Keras. MNIST example.
import tensorflow as tf
# credit: https://stackoverflow.com/a/66524901/9215780
class CustomTrainStep(tf.keras.Model):
def __init__(self, n_gradients, *args, **kwargs):
super().__init__(*args, **kwargs)
self.n_gradients = tf.constant(n_gradients, dtype=tf.int32)
self.n_acum_step = tf.Variable(0, dtype=tf.int32, trainable=False)
self.gradient_accumulation = [tf.Variable(tf.zeros_like(v, dtype=tf.float32),
trainable=False) for v in self.trainable_variables]
@gamanakis
gamanakis / astro.md
Last active August 30, 2021 21:10 — forked from rickbassham/README.md
Step by Step Instructions to create an Open Source Astro-Imaging Computer

Instructions (works on amd64 and arm64)

A copy/paste guide to getting a full working astro-imaging computer running on Ubuntu 20.04 LTS. Installs latest stable versions of gpsd, KStars, INDI, OACapture, SkyChart, ASTAP, and Astrometry.net.

It uses the lightweight XFCE4 desktop, and allows you to VNC in, running everything locally on the astro-imaging pc.

Install Ubuntu Server 20.04.1

@gamanakis
gamanakis / grep-with-gpg.sh
Created June 10, 2021 07:23 — forked from bogn83/grep-with-gpg.sh
A simple bash script to grep within a bunch of GPG encrypted files.
#!/bin/bash
#
# Usage grep-with-gpg path/to/encrypted/files/*
#
if [ -z "$1" ]; then
echo "Usage: $0 'search string' [path/to/encrypted/files/*]";
exit 1;
else
SEARCH=$1;
#!/bin/bash
if [ -d "/store" ]; then
echo "Destroy the array first. Or don't. That's kinda the point of this message."
exit 1
fi
echo SERIAL1 $( smartctl --attributes /dev/disk/by-id/ata-MODEL_SERIAL1 | grep UDMA )
echo SERIAL2 $( smartctl --attributes /dev/disk/by-id/ata-MODEL_SERIAL2 | grep UDMA )
echo SERIAL3 $( smartctl --attributes /dev/disk/by-id/ata-MODEL_SERIAL3 | grep UDMA )
@gamanakis
gamanakis / 256 colors.md
Created November 3, 2020 22:25 — forked from limingjie/256 colors.md
256 colors in putty, tmux/screen and vim

#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.

  • putty

    Set Connection -> Data -> Terminal-type string to xterm-256color

  • tmux

Add this line to ~/.tmux.conf

@gamanakis
gamanakis / gist:95e8d1a6429c5a87dcd1699390536771
Created February 28, 2020 19:23 — forked from Fusl/gist:3a708b8c32c9d5264fa0
Streaming audio output from Linux (Pulseaudio) to Windows
# Windows (receiver) side:
.\ffplay.exe -nodisp -ac 2 -acodec pcm_u8 -ar 48000 -analyzeduration 0 -probesize 32 -f u8 -i udp://0.0.0.0:18181?listen=1
# Linux (transmitter) side:
pactl load-module module-null-sink sink_name=remote
ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_u8 -ar 48000 -f u8 "udp://RECEIVER:18181"
pavucontrol # Change the default output to the Null sink or move single applications to this "output" device.