Skip to content

Instantly share code, notes, and snippets.

View 3dprogramin's full-sized avatar

Andrei 3dprogramin

View GitHub Profile
@3dprogramin
3dprogramin / maintenance.html
Last active April 3, 2024 07:15
Simple maintenance page
<!DOCTYPE html>
<html>
<head>
<title>Mentenanță</title>
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
html {
width: 100%;
@3dprogramin
3dprogramin / electron-stdout-interceptor.js
Last active January 16, 2024 21:12
Windows electron app stdout interceptor
const { spawn } = require('child_process');
const ls = spawn("C:\\path\\to\\electron\\binary.exe");
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
@3dprogramin
3dprogramin / aes.go
Created November 9, 2021 09:13 — forked from willshiao/aes.go
AES 256-CFB in Node.js, Go, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
@3dprogramin
3dprogramin / password_generator.py
Created October 14, 2021 14:36
Password generator
#!/usr/bin/python
import string, random, sys, os
# requires xclip to be installed
# copy to clipboard
def copy2clip(text):
os.system(f'echo -n "{text}" | xclip -sel clip')
@3dprogramin
3dprogramin / conky exchange
Created January 20, 2021 09:47
Script for gathering currency values every X minutes, and saving them to text files for conky usage
#!/bin/python3
import requests as req
from lxml import html
from time import gmtime, strftime
import json
OUTPUT_FILE_USD = '/home/icebox/.config/conky/exchange/usd.txt'
OUTPUT_FILE_EURO = '/home/icebox/.config/conky/exchange/euro.txt'
OUTPUT_FILE_BTC = '/home/icebox/.config/conky/exchange/btc.txt'
@3dprogramin
3dprogramin / selenium-cookies-importer.py
Last active January 5, 2024 19:51
Import cookies from text file into selenium webdriver
from selenium import webdriver
from time import sleep
# read cookies from file
# format
# ... expiry1 key1 value1
# ... expiry2 key2 value2
def read_cookies(p = 'cookies.txt'):
cookies = []
with open(p, 'r') as f:
@3dprogramin
3dprogramin / mysite.conf
Last active March 28, 2019 11:56
NGINX configuration for proxifying pm2 clustered app using socket.io, with SSL
upstream mysite {
ip_hash;
server localhost:8080;
}
// HTTP server for redirecting to HTTPs
server {
listen 80;
listen [::]:80;
server_name mysite.com;
@3dprogramin
3dprogramin / conky.conf
Last active February 17, 2018 20:19
Personal conky config file: Linux ArchBang kernel 4.14.19-1-lts, openbox 3.6.1
-- Conky config
-- adapted by 3dprogramin
-- original from Mr Green, ArchBang
conky.config = {
background = true,
use_xft = true,
font = 'monospace:size=10',
xftalpha = 1,
update_interval = 1.0,