Skip to content

Instantly share code, notes, and snippets.

View vi7's full-sized avatar
💭
smd

Vitaliy D. vi7

💭
smd
  • Krakow, Poland
View GitHub Profile
@FiloSottile
FiloSottile / 32.asm
Last active May 16, 2024 19:56
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@erkkap
erkkap / PlainTextClipboard
Created January 25, 2014 12:17
This AppleScript converts the clipboard contents to plain text and shows a notification
-- This AppleScript converts the clipboard contents to plain text
set the clipboard to (get the clipboard as text)
-- Show notification with a preview
display notification (the clipboard) with title ("PlainTexted!")
-- Add a small delay so the notification has the time to launch
delay 2
@soarez
soarez / ca.md
Last active June 19, 2024 19:32
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@magnetikonline
magnetikonline / README.md
Last active May 25, 2024 01:30
Bash getopts template.

Bash getopts template

#!/bin/bash -e

function usage {
	cat <&2
@HokieGeek
HokieGeek / buspirate-bulkrom.py
Last active January 17, 2021 12:47
Trying out bus pirate binary mode in python and haskell
#!/usr/bin/python
import serial
import signal
import sys
import time
def BinaryModeEnter(connection):
connection.flushInput()
for x in range(0, 20): # Try at most 20 times
@Informatic
Informatic / README.md
Last active June 20, 2024 14:31
cloud-init "nocloud" networking setup

cloud-init is absolute cancer. Its code is horrible. It has no documentation at all.

It took me 5 fucking hours to figure out how to properly configure networking on recent cloud-init (Ubuntu 16.04 cloud image) with local datasource.

It's not mentioned anywhere you need to provide dsmode: local. (but only if you need network-config, besides that everything is fine; someone below noted that -m flag does the same thing, good to know) Of course nobody needs documentation for network-config format either. (cloudinit/net/__init__.py is a protip, enjoy the feces dive)

Oh, and by the way - no, it's not possible to provide network-config to uvt-kvm without patching shit.

@LarsBergqvist
LarsBergqvist / door_open_detector.ino
Created July 25, 2016 08:12
Digispark USB board sketch for sending an 433MHz RF signal when a door is opened
// A sketch for a DigiSpark USB device that detects when a door is opened
// The door should have a reed switch with NC (normally closed) connected to the Vin wire of the device
// When the door is opened, the reed switch is closed and the device is started
// A 32-nit message is then sent via a 433 MHz signal that can be picked up by an appropriate receiver
// (a Raspberry Pi in my case).
// When the door is closed, the reed switch is opened and the device is shut down
//
// Depends on the RCSwitch library https://github.com/sui77/rc-switch
// and the eeprom-library
//
@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@u1735067
u1735067 / sparse_img_to_ext4.py
Last active March 30, 2021 14:05
Python script to convert sparse ext4 Android images (like cache.img[.ext4], hidden.img[.ext4] to openable ext4 images (like with 7zip)
#! /usr/bin/env python
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@catichenor
catichenor / type_from_clipboard.applescript
Last active August 9, 2023 13:54
Type text from the clipboard with AppleScript/Automator
--Adapted from http://apple.stackexchange.com/questions/194567/how-can-i-use-applescript-to-type
--Types text in where TypeIt4Me dare not tread (like in a VNC session).
on run {input, parameters}
tell application "System Events"
set textToType to the clipboard
delay 1
keystroke textToType
end tell