Skip to content

Instantly share code, notes, and snippets.

View wizofe's full-sized avatar
😬
Focusing

Ioannis Valasakis wizofe

😬
Focusing
View GitHub Profile
@wizofe
wizofe / DevBoxStarter.ps1
Last active December 9, 2022 10:57 — forked from myty/DevBoxStarter.ps1
DevBoxStarter
# POWERSHELL
Update-ExecutionPolicy Unrestricted
# Install Chocolatey
if ((Get-Command "choco" -ErrorAction SilentlyContinue) -eq $null)
{
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}
function Invoke-RefreshEnvironment {
@wizofe
wizofe / python2pdf.sh
Last active August 15, 2019 15:04 — forked from smoitra87/python2pdf.sh
Convert python files to pdf and concatenate all pdfs. Requires pygmentize, pdflatex and pdftk
#!/bin/sh
# Run as ./python2pdf.sh $(ls *.py)
# For Debian the requirements are
# sudo apt install pdftk python3-pygments texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
outdir=${HOME}/tmp
mkdir ${outdir}
allpdfs=""
@wizofe
wizofe / python2pdf.sh
Created August 15, 2019 15:02 — forked from smoitra87/python2pdf.sh
Convert python files to pdf and concatenate all pdfs. Requires pygmentize, pdflatex and pdftk
#!/bin/sh
allpdfs=""
for f in "$@" ; do
filename=$(basename "$f")
filename="${filename%.*}"
pygmentize -f tex -O linenos -O title=$( echo $filename | tr '_' '-').py -O full -O style=default -o /tmp/$filename.tex $f
pdflatex -jobname=$filename -output-directory=/tmp /tmp/$filename.tex
allpdfs="$allpdfs /tmp/$filename.pdf"
from __future__ import print_function
import os
import glob
import re
import json
from pprint import pprint
import comtypes.client as ct
from comtypes import COMError
### Credits:
@wizofe
wizofe / gist:8726a97b2fbba66ecf2f31962d6f0ffa
Created April 12, 2019 00:45 — forked from todgru/gist:4128695
Git Keeps asking for username password clone ssh git https

Keybase proof

I hereby claim:

  • I am wizofe on github.
  • I am wizofe (https://keybase.io/wizofe) on keybase.
  • I have a public key ASBu40xOEbGwtW3EyyMTghrgv90RTWbjkkPtDE0UU5sexQo

To claim this, I am signing this object:

@wizofe
wizofe / hk960mode
Last active July 29, 2018 23:28
hikey960-modes
╔═══════════════╦═════════════════════╤═════════════╤═══════════════╤═══════════════╗
║ Name ║ Link / Switch │ Normal Mode │ Fastboot Mode │ Recovery Mode ║
╠═══════════════╬═════════════════════╪═════════════╪═══════════════╪═══════════════╣
║ Auto Power up ║ Link 1-2 / Switch 1 │ closed / ON │ closed / ON │ closed / ON ║
║ Recovery ║ Link 3-4 / Switch 2 │ open / OFF │ open / OFF │ closed / ON ║
║ Fastboot ║ Link 5-6 / Switch 3 │ open / OFF │ closed / ON │ open / OFF ║
╚═══════════════╩═════════════════════╧═════════════╧═══════════════╧═══════════════╝
@wizofe
wizofe / servant.sh
Last active July 12, 2018 11:03
Start systemd/init level services sequentially
#!/bin/sh
# Start all system services sequentially
wants=$(systemctl show -p Wants multi-user.target | sed 's/^Wants=//' | tr ' ' '\n' | sort)
log=/var/tmp/multi-user-steps-$(date +%Y%m%d-%H%M%S)
log () {
echo "$* ..." | tee -a "$log"
sync
@wizofe
wizofe / newtrace.py
Created April 4, 2018 14:43
dtrace tps.py
SYSCALL(args) = return
Traceback (most recent call last):
File "tps.py", line 2, in <module>
os.getgrouplist('wizofe', 20)
FileNotFoundError: [Errno 2] No such file or directory
madvise(0x101956000, 0x3000, 0x5) = 0 0
open("/dev/dtracehelper\0", 0x2, 0xFFFFFFFFEE6E8BA0) = 3 0
ioctl(0x3, 0x80086804, 0x7FFEEE6E8B00) = 0 0
close(0x3) = 0 0
access("/AppleInternal/XBS/.isChrooted\0", 0x0, 0x0) = -1 Err#2
@wizofe
wizofe / dtrace.log
Created April 4, 2018 14:36
dtrace_python_posix
SYSCALL(args) = return
== CPython 3.8.0a0 (heads/master:da58533ac6, Apr 3 2018, 16:54:53) [Clang 9.1.0 (clang-902.0.37.1)]
== Darwin-17.5.0-x86_64-i386-64bit little-endian
== cwd: /Volumes/pythontesting/cpython/build/test_python_26294
== CPU count: 4
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 2.15 [1/1] test_posix
testNoArgFunctions (test.test_posix.PosixTester) ... ok
test_access (test.test_posix.PosixTester) ... ok