Skip to content

Instantly share code, notes, and snippets.

@apostoloss
apostoloss / chatgpt.sh
Created March 2, 2023 11:45
chatgpt query from cli
#!/usr/bin/env bash
# openai api token
# use gopass to keep this or just replace it below (nah)
BEARER="$(gopass show openai_api)"
# api configuration
MODEL="text-davinci-003"
TEMPERATURE="0"
MAX_TOKEN=4000
@apostoloss
apostoloss / isyubikey.py
Last active October 2, 2021 19:22
small function to check if a string is yubikey or not just based on length and if all chars are in the modhex
def isYubikey(string):
"""
Checks if a string looks like a yubikey.
Yubikey strings are exactly 44 characters and use modhex
"""
modhex = "cbdefghijklnrtuv"
if len(string) != 44:
return False
for i in string:
if i not in modhex:
@apostoloss
apostoloss / git-aware-bash-prompt.md
Created September 30, 2019 07:58 — forked from eliotsykes/git-aware-bash-prompt.md
Git Aware Bash Prompt
@apostoloss
apostoloss / add-ns.py
Created September 30, 2019 07:57 — forked from deltaroe/add-ns.py
#!/usr/bin/env python
import yaml
import sys
for manifest in yaml.load_all(sys.stdin):
if manifest:
if 'metadata' in manifest and 'namespace' not in manifest['metadata']:
manifest['metadata']['namespace'] = sys.argv[1]
print '---'

Keybase proof

I hereby claim:

  • I am apostoloss on github.
  • I am apostoloss (https://keybase.io/apostoloss) on keybase.
  • I have a public key whose fingerprint is 30FE ACF2 A133 342D 9C25 8D0B 94BC 533D F04C 7158

To claim this, I am signing this object:

@apostoloss
apostoloss / MQTT_ESP8266_temperature_humidity.ino
Created December 1, 2016 12:32 — forked from balloob/MQTT_ESP8266_temperature_humidity.ino
Sketch for the ESP8266 to publish temperature and humidity values received from a DHT22 to MQTT
// Get ESP8266 going with Arduino IDE
// - https://github.com/esp8266/Arduino#installing-with-boards-manager
// Required libraries (sketch -> include library -> manage libraries)
// - PubSubClient by Nick ‘O Leary
// - DHT sensor library by Adafruit
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <DHT.h>
@apostoloss
apostoloss / keybase.md.old
Last active October 30, 2017 14:42
public gist for keybase.io
### Keybase proof
I hereby claim:
* I am apostoloss on github.
* I am apostoloss (https://keybase.io/apostoloss) on keybase.
* I have a public key whose fingerprint is 4A9F E6ED 8B35 7AFF 49A8 B235 E338 F18B 9FE3 74CF
To claim this, I am signing this object: