Skip to content

Instantly share code, notes, and snippets.

View mnemocron's full-sized avatar
:octocat:
bonk!

Simon Burkhardt mnemocron

:octocat:
bonk!
View GitHub Profile

CLI cheat sheet

My personal cheatsheet for using the Linux command line.


Windows

Linux Subsystem

@mnemocron
mnemocron / Fensterfunktionen.java
Last active April 27, 2018 14:15
Fensterfunktionen für Signalverarbeitung
package pro2e.matlabfunctions;
import java.math.BigDecimal;
public class Fensterfunktionen {
/**
* @brief enumerations for the different window functions
*/
public static final int RECTANGULAR = 0;
public static final int CHEBYSHEV = 1;
@mnemocron
mnemocron / STM32HAL_printf_uart.c
Created May 17, 2018 13:48
Redirect printf() to UART on STM32 microcontroller
/* USER CODE BEGIN Includes */
#include <stdio.h>
/* USER CODE BEGIN 0 */
@mnemocron
mnemocron / dynip-alert.py
Created June 21, 2018 12:01
Script that compares the first input argument (the domain) to the current external IP. If they do not match it attempts to send a Telegram message.
#!/usr/bin/python
# python 2.7
#_*_ coding: utf-8 _*_
"""
@file dynip-alert.py
@author Simon Burkhardt - simonmartin.ch
@date 2018-03-01
@version 1.1
@copyright CC0 - https://creativecommons.org/publicdomain/zero/1.0
@mnemocron
mnemocron / RGBWDriver.ino
Created June 22, 2018 18:49
Inherited Class from Adafruit_PWMServoDriver
class RGBWDriver : public Adafruit_PWMServoDriver
{
private:
uint8_t ch_R;
uint8_t ch_G;
uint8_t ch_B;
uint8_t ch_W;
void setChannels(uint8_t r, uint8_t g, uint8_t b, uint8_t w)
{
this->ch_R = r;
@mnemocron
mnemocron / random-question.sh
Created June 24, 2018 08:13
dubblebubble.tumblr.com/post/137833419195/these-are-actually-hella-fucking-cute-yall
#!/bin/bash
python -c "import random
questions = ['1: when you have cereal, do you have more milk than cereal or more cereal than milk?',
'2: do you like the feeling of cold air on your cheeks on a wintery day?',
'3: what random objects do you use to bookmark your books?',
'4: how do you take your coffee/tea?',
'5: are you self-conscious of your smile?',
'6: do you keep plants?',
@mnemocron
mnemocron / template.py
Created July 6, 2018 20:05
Python Template
#!/usr/bin/python
#_*_ coding: utf-8 _*_
'''
@file
@author
@date
'''
# ===== COLORS =====
@mnemocron
mnemocron / file2json.php
Created July 13, 2018 10:02
returns json from a json file.
<?php
header('Content-type: application/json');
$filename = $_GET['f'];
$json_path = './resources/' . $filename;
if (file_exists($json_path) && strcmp(pathinfo($filename, PATHINFO_EXTENSION), 'json') ==0 ) {
$myfile = fopen($json_path, 'r') or die('Unable to open file!');
@mnemocron
mnemocron / Arduino_hex_to_int.cpp
Created July 22, 2018 09:43
Converts a String in hexadecimal to an Integer
uint32_t htoi( String htoi_str ){
char itoh_lower[18] = {"0123456789abcdef"}; // 16 chars + null
char itoh_upper[18] = {"0123456789ABCDEF"}; // 16 chars + null
uint32_t htoi_number = 0;
for(int index = 0; index < htoi_str.length(); index ++){ // each hex number in String
for(int val = 0; val < 16; val ++){ // each possible value
if ( htoi_str[htoi_str.length() -index -1] == itoh_lower[val] ||
htoi_str[htoi_str.length() -index -1] == itoh_upper[val] ){
if(val > 0){