Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tomazursic's full-sized avatar

Tomaz Ursic tomazursic

View GitHub Profile
@tomazursic
tomazursic / index.html
Created April 28, 2021 07:15
Boilerplate
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Unique page title - My Site</title>
<script type="module">
document.documentElement.classList.remove('no-js');

Mount NTFS filesystem

# using this on osx derivate
sudo /usr/local/bin/ntfs-3g /dev/disk2s1 /Volumes/NTFS -olocal -oallow_other

Transfer disk image file on external drive with dd progress

# at the cost of speed! 

sudo pv -tpreb .iso | sudo dd of=/dev/disk2 bs=4M

@tomazursic
tomazursic / newclient.sh
Created February 14, 2019 16:53
Generate OpenVPN keys
#!/bin/bash
# Current file directory path
DIR="$(cd "$(dirname "$0")" && pwd)"
cd $DIR
generate_keys () {
key_dir=keys
archive=client-$ID.zip
base_config=base-client.conf
# source : https://pypi.org/pypi?%3Aaction=list_classifiers
Development Status :: 1 - Planning
Development Status :: 2 - Pre-Alpha
Development Status :: 3 - Alpha
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
Development Status :: 6 - Mature
Development Status :: 7 - Inactive
Environment :: Console
@tomazursic
tomazursic / micropython.rst
Last active August 28, 2018 11:11
Notes for building micropython

MicroPython

Build

Install dependences

@tomazursic
tomazursic / vim-build.sh
Last active August 14, 2018 23:18
vim-build
# liblua5.1-dev luajit libluajit-5.1
sudo apt-get install liblua5.1-0-dev \
libluajit-5.1-dev \
libluajit-5.1-2 \
libluajit-5.1-common
sudo apt-get install python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall

Pycom building a firmware image

Requirements

  • Pycom MicroPython source code
  • Xtensa gcc compiler
  • Espressif IoT Development Framework

Debian/Ubuntu

@tomazursic
tomazursic / upgrade_stretch_to_buster.sh
Last active July 15, 2019 02:25
Upgrade Jessie to Stretch
#!/bin/bash
sudo apt-get update && \
sudo apt-get upgrade && \
sudo apt-get dist-upgrade && \
dpkg -C && \
apt-mark showhold && \
sudo rpi-update && \
sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list && \
sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list && \

Raspbeerry Pi USB gadget

  1. Fresh sd card with Raspbian

  2. Enable ssh

Add empty file "ssh" to /boot partition on SD card

Add to config.txt

@tomazursic
tomazursic / arange_by_P.bat
Last active December 24, 2022 21:31
Arange icons on windows desktop into falus
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;