Skip to content

Instantly share code, notes, and snippets.

@dk2ro
dk2ro / sweep.py
Last active December 13, 2018 21:37
Frequency response measurement of a two-port with the ADALM-PLUTO
import iio
import time
import struct
import matplotlib.pyplot as plt
import numpy.fft as fft
import numpy as np
import math
def set_rx_freq(freq):
#CXRLE Pos=-7289,-1110
x = 10016, y = 6796, rule = B3/S23
5843b2o$5843b2o4$5861bobo$5856bo4bo2bo$5857b2o5b2o8bo$5852b2o8bo3b2o5b
obo$5852b2o10b2o6bob2o$5841b2obob2o13bo2bo6b2ob2o$5861bobo8bob2o$5841b
o5bo25bobo8b2o$5864bo9bo9bobo$5842b2ob2o16bo22bo$5844bo18b3o20b2o6$
5847bo17b2o$5841b3o4b2o15b2o$5840bo3bo2b2o2$5839bo5bo$5839b2o3b2o2$
5864b2o$5864bobo$5866bo$5866b2o$5839b2o$5840bo$5837b3o$5837bo7$5851bo$
5851b3o$5854bo14bobo$5853b2o6b2o7b2o5b2o$5860bobo7bo6bo$5861bo16b3o$
5880bo2$5848b2o$5848b2o6b2o29b2o$5856b2o28bo2bo$5887b2o$5865b2o20b2o$
5865b2o19b2o8b2o$5885b2obo6bobo$5850b2o33b2obo7bo$5849bobo35bo$5849bo
@marcan
marcan / linux.sh
Last active December 1, 2023 15:18
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@albertzak
albertzak / main.c
Created May 13, 2016 06:52
boundedbuffer
/*****************************
* Fernlehre Bounded Buffer
* File: main.c
* Author: Granzer Wolfgang
* Version: 1.1
* Date: 05.05.2015
**/
#include <stdio.h>
#include <stdlib.h>
@oxguy3
oxguy3 / RoughScroll.js
Last active September 27, 2023 15:02
Greasemonkey script for disabling smooth scrolling across the web (WIP! currently breaks a few websites, unfortunately)
// ==UserScript==
// @name RoughScroll
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disables smooth scrolling on ALL websites
// @author Hayden Schiff (oxguy3)
// @match *://*/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@gbaman
gbaman / HowToOTG.md
Last active May 16, 2024 20:10
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@developius
developius / README.md
Last active April 25, 2024 22:15
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname