Skip to content

Instantly share code, notes, and snippets.

show sda sdb devices:
lsblk
unmount your device:
sudo umount /dev/sda1
sudo dd if=artful-desktop-amd64.iso of=/dev/sda bs=1M status=progress
you are awesome!

to install software

sudo add-apt-repository -y ppa:myriadrf/drivers

sudo apt-get update

sudo apt-get install python3-numpy python3-scipy soapysdr-tools python3-soapysdr

sudo apt-get install python-dev swig

@Skyedragon
Skyedragon / CleanUbuntu.md
Last active January 15, 2020 09:46
Clean Ubuntu installation restore points

timeshift - program for restore points for Linux

sudo add-apt-repository -y ppa:teejee2008/ppa - to add repository

sudo apt-get update --allow-insecure-repositories - to download stuff from unsecured repos

sudo apt install timeshift

sudo timeshift-gtk - start timeshift with GUI

@Skyedragon
Skyedragon / Symbol_replace.py
Created July 12, 2018 14:10
this function takes symbol and change it to another in the given file
#this function takes symbol and change it to another in the given file
def symbolchange(old_file, new_file, old_symbol, new_symbol):
with open(new_file, "w", encoding = 'utf-8') as f:
for line in fileinput.input([old_file], inplace = False):
f.write(line.replace(old_symbol, new_symbol))
@Skyedragon
Skyedragon / uniform+FFT.py
Created November 3, 2017 16:29
simple python code for FFT using numpy and scipy
import numpy as np
from scipy.fftpack import fft
import matplotlib.pyplot as plt
# Number of sample points
N = 600
# sample spacing
T = 1.0 / 800.0
x = np.linspace(0.0, N*T, N)
y = np.sin(10.0 * 2.0*np.pi*x) + 0.5*np.sin(80.0 * 2.0*np.pi*x)
@Skyedragon
Skyedragon / motorcontroller.py
Created September 21, 2017 11:53
some temporary code for stepper motor driver
'''
This program was created during and for Vactanilad
It drives the stepper motors using ethernet connection to GSI network (TCP protocol)
Useful commands:
@ - start of the command: @03
0 - number of machine
@03 - initialize both axis, X and Y
R,r - return to 0
A,a = move to absolute coordinate IN STEPS
@Skyedragon
Skyedragon / How to add quotes in LaTeX
Last active September 6, 2017 14:59
How to add quotes in LaTeX
\textquotedbl A resonant Schottky pickup for the study of highly charged ions in storage rings." Phys. Scripta T156 (2013)
will give
"A resonant Schottky pickup for the study of highly charged ions in storage rings." Phys. Scripta T156 (2013)
All other methods will give `` '' like German quotes
@Skyedragon
Skyedragon / FFT-training.py
Created September 6, 2017 11:11
Here I try to work with FFT and numpy
#!/usr/bin/env python
#coding=utf8
from numpy import array, arange, abs as np_abs
from numpy.fft import rfft, rfftfreq
from numpy.random import uniform
from math import sin, pi, cos
import matplotlib.pyplot as plt
# а можно импортировать numpy и писать: numpy.fft.rfft
FD = 22050 # частота дискретизации, отсчётов в секунду