Skip to content

Instantly share code, notes, and snippets.

View ayufan's full-sized avatar

Kamil Trzciński ayufan

View GitHub Profile
@ayufan
ayufan / run-omnibus.sh
Created March 5, 2020 17:52
Run Omnibus GitLab
#!/bin/bash
set -ex
IMAGE="${1:-gitlab/gitlab-ce:latest}"
shift
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)
trap "rm -rf $tmp_dir" EXIT
@ayufan
ayufan / gpg-agent-watcher.bash
Created March 5, 2020 14:00
GPG Agent Watcher to show Mac OS notify when SSH sign happens
#!/bin/bash
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
DETECT=${DETECT:-notify}
LABEL=eu.ayufan.gpg-agent-watcher
TARGET=~/Library/LaunchAgents/$LABEL.plist
GPG_AGENT_CONF=~/.gnupg/gpg-agent.conf
@ayufan
ayufan / nordvpn.rock64.md
Created August 26, 2019 10:52
Install NordVPN on rock64
@ayufan
ayufan / download-stats.rb
Last active July 3, 2019 11:11
Simple Ruby script to gather metrics from GitHub Releases
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile true do
source 'http://rubygems.org'
gem 'table_print'
end
require 'json'
@ayufan
ayufan / asound-amix.txt
Created June 21, 2019 15:07
`/proc/asound/amix` from Android playing audio
rk3399_mid:/proc/asound # amix
Card:0
id iface dev sub idx num perms type name
1 MIXER 0 0 0 2 rw R INT32 HP Playback Volume: 0 0 { 0-0 }
2 MIXER 0 0 0 2 rw R INT32 HPMixer Gain: 3 3 { 0-7 }
3 MIXER 0 0 0 2 rw R INT32 DAC Playback Volume: 192 192 { 0-192 }
4 MIXER 0 0 0 1 rw BOOL Enable DAC Soft Ramp: ON { OFF=0, ON=1 }
5 MIXER 0 0 0 1 rw INT32 DAC Soft Ramp Rate: 0 { 0-4 }
6 MIXER 0 0 0 1 rw ENUM Playback Polarity: (0 Normal) { Normal=0, R Invert=1, L Invert=2, L + R Invert=3 }
7 MIXER 0 0 0 1 rw BOOL DAC Notch Filter: OFF { OFF=0, ON=1 }
@ayufan
ayufan / rk3399-pinebook-pro-v2-android.dts
Created June 5, 2019 09:51
Android DTS for Pinebook Pro v2
/dts-v1/;
/memreserve/ 0x0000000005600000 0x0000000000014000;
/memreserve/ 0x0000000005bf0000 0x00000000001ad6cc;
/ {
compatible = "rockchip,rk3399-mid\0rockchip,rk3399";
interrupt-parent = < 0x01 >;
#address-cells = < 0x02 >;
#size-cells = < 0x02 >;
@ayufan
ayufan / MSI_LED.cs
Created February 14, 2019 09:45
The MBAPI_x86.dll interface
namespace MSI_LED
{
using System;
using System.Runtime.InteropServices;
internal static class MB
{
internal const string MB_DLL_FileName = @"Lib\MBAPI_x86.dll";
[DllImport(@"Lib\MBAPI_x86.dll")]
#!/bin/bash
join_by() {
local IFS=","
echo "$*"
}
get_data() {
local QUERIES=$(join_by "$@")
while read -d "," VALUE REST; do
@ayufan
ayufan / sdcard-vs-ssd.md
Created December 22, 2018 16:20
Rock64 SDCard vs SSD

SDCard Samsung EVO+ 32GB

Command line used: iozone -e -I -a -s 100M -r 16k -r 512k -r 1024k -i 0 -i 1 -i 2 -f /sdcard/test

                                                          random    random     bkwd    record    stride                                    
          kB  reclen    write  rewrite    read    reread    read     write     read   rewrite      read   fwrite frewrite    fread  freread
      102400      16     8490     9201    14664    14678    14657     8770                                                          
      102400     512    20849    21052    22413    22475    22452    20742                                                          
      102400    1024    15644    18549    22679    22703    22702    20718       
@ayufan
ayufan / docker-bionic-ssh-server.bash
Last active November 14, 2018 18:38
Run simplest docker bionic server
docker run --rm ubuntu:bionic 'apt-get update -y && apt-get install -y openssh-server && useradd -g -s /bin/bash -m ayufan && mkdir -p /run/sshd && echo ayufan:ayufan | chpasswd && exec /usr/sbin/sshd -D'