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 / mk_test.sh
Last active April 2, 2018 19:03
make test output
======================================================================
FAIL: test_glob (test.test_pathlib.PosixPathTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Volumes/MyHeart/_dev/code/cpython/Lib/test/test_pathlib.py", line 2119, in test_glob
self.assertEqual(given, expect)
AssertionError: Items in the first set but not the second:
PosixPath('/Volumes/MyHeart/_dev/code/cpython/build/test_python_60842/@test_60842_tmp/FILEa')
@wizofe
wizofe / pyfailed.sh
Created April 3, 2018 15:27
pydev failed test
======================================================================
ERROR: test_getgrouplist (test.test_posix.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/wizofe/kano/cpython/Lib/test/test_posix.py", line 972, in test_getgrouplist
self.assertIn(group, posix.getgrouplist(user, group))
OSError: [Errno 25] Inappropriate ioctl for device
----------------------------------------------------------------------
@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
@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 / 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 / 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 ║
╚═══════════════╩═════════════════════╧═════════════╧═══════════════╧═══════════════╝

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 / gist:8726a97b2fbba66ecf2f31962d6f0ffa
Created April 12, 2019 00:45 — forked from todgru/gist:4128695
Git Keeps asking for username password clone ssh git https
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 / 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"