This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git prompt | |
GIT_PS1_SHOWUPSTREAM="auto" | |
GIT_PS1_SHOWCOLORHINTS="yes" | |
GIT_PS1_SHOWDIRTYSTATE="yes" | |
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w $(__git_ps1 "\[\033[01;35m\]%s\[\033[34m\]")\$\[\033[00m\] ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://www.radiorock.fi/api/content?tagCategory=info&page=0'; | |
$data = file_get_contents($url); | |
preg_match('/http:\/\/icelive.*?mp3/', $data, $m); | |
$stream_url = $m[0]; | |
header("Location: $stream_url"); | |
exit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "deb http://repo.vivaldi.com/stable/deb/ stable main" | sudo tee /etc/apt/sources.list.d/vivaldi.list > /dev/null | |
wget -O - http://repo.vivaldi.com/stable/linux_signing_key.pub | sudo apt-key add - | |
sudo apt update && sudo apt install vivaldi-stable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -sEi.bak 's/\(awk/\(LD_LIBRARY_PATH= awk/g' /opt/Xilinx/{Vivado,SDK}/2016.4/bin/loader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Scripted from http://serverfault.com/questions/127636/force-local-ip-traffic-to-an-external-interface | |
DEV_0="ens6f0" | |
DEV_1="ens6f1" | |
MAC_0=`ifconfig ${DEV_0}|awk 'NR==1 {print $5}'` | |
MAC_1=`ifconfig ${DEV_1}|awk 'NR==1 {print $5}'` | |
IP_0="192.168.100.1" | |
IP_1="192.168.101.1" | |
FAKE_0="192.168.102.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
tofrodos \ | |
iproute \ | |
tftpd-hpa \ | |
gawk \ | |
gcc \ | |
make \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <smmintrin.h> | |
void memcpy_16to32(uint32_t *pdst_, const uint16_t *psrc_, size_t n) | |
{ | |
size_t items = n / sizeof(uint16_t); | |
__m128i *psrc = (__m128i *) psrc_; | |
__m128i *pdst = (__m128i *) pdst_; | |
while (items >= 8) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Retrieves Espoo calendar for the given unit and writes separate .ics files for each given group. | |
# 2020-03-01 Pekka Korpinen <[email protected]> | |
import time | |
import argparse | |
import requests | |
import ics | |
def get_unit_data(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Finnish umlauts on ANSI keyboard", | |
"rules": [ | |
{ | |
"description": "Right alt + ;' to öä (with or without shift)", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "semicolon", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Saves the current document in Google Docs as PDF to the same folder. | |
// Code from https://stackoverflow.com/questions/28312992/convert-google-doc-to-pdf-using-google-script-editior | |
// Just added onOpen() to add the script to the menubar. | |
function onOpen() { | |
var ui = DocumentApp.getUi(); | |
// Or DocumentApp or FormApp. | |
ui.createMenu('My scripts') | |
.addItem('Convert to PDF', 'convertPDF') | |
.addToUi(); |