Skip to content

Instantly share code, notes, and snippets.

View masip85's full-sized avatar

Vicente Masip masip85

View GitHub Profile
@dayne
dayne / 0-ssh-agent_checker_launcher.md
Last active September 28, 2024 05:38
ssh-agent checker/launcher

ssh-agent checker/launcher

About

A bash script for managing ssh-agent that I use for Ubuntu and OSX.

Started as a variation from this classic on Stack Overflow How to check if ssh-agent is already running and then adapted it to align with behaivor I want.

This version does the following:

  • checks for ssh agent forward (remote login) and if so does not setup ssh-agent or any keys
@denisgolius
denisgolius / generate-ssh-key.sh
Created October 4, 2018 06:55 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@endolith
endolith / DFT_ANN.py
Last active April 30, 2025 19:25
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
import matplotlib.pyplot as plt
import numpy as np
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
N = 32
batch = 10000
@zhangpengGenedock
zhangpengGenedock / git clone specific commit branch
Created October 19, 2017 03:52
git clone specific commit branch
What else can you do?
How to clone repository to a specific commit? (full clone)
# Create empty repository to store your content
git clone <url>
git reset <sha-1> --hard
More info:
How to clone single branch?
@santi-pdp
santi-pdp / Generative Adversarial Networks toy example.ipynb
Created February 16, 2017 18:36
A toy example on Generative Adversarial Networks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ninedraft
ninedraft / README.md
Last active July 6, 2024 05:58
Python udp broadcast client server example.

Python udp broadcast client-server example

⚠️ ❗ ATTENTION ❗ ⚠️

This gist is deprecated and will not be edited in the future. Consider visit ninedraft/python-udp repo. It will not be deleted, however.

⚠️ ❗ ATTENTION ❗ ⚠️

@claczny
claczny / fit_and_plot_normal_mixtures.R
Created September 6, 2016 11:08
Fit and plot the fitted components of a multi-modal distribution assuming normal distributions as the components.
library(ggplot2)
library(plyr)
library(mixtools)
###
# GLOBAL THEME AND GLOBAL AESTHETICS
###
old <- theme_set(theme_bw() +
theme(text = element_text(size=12),
axis.title = element_text(size = 14, face="bold"),
from __future__ import print_function
import numpy as np
from timeit_utils import timeit_fast
from numpy.random import rand
import matplotlib.pyplot as plt
import datetime
import socket
import sys
N_max = 100000
@internaut
internaut / pandas_crossjoin_example.py
Last active June 12, 2020 14:30
Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on calculating the distances between origin and destination cities. See https://mkonrad.net/2016/04/16/cross-join--cartesian-product-between-pandas-dataframes.html
"""
Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on
calculating the distances between origin and destination cities.
Tested with pandas 0.17.1 and 0.18 on Python 3.4 and Python 3.5
Best run this with Spyder (see https://github.com/spyder-ide/spyder)
Author: Markus Konrad <[email protected]>
April 2016
@endolith
endolith / diff of phase spectrogram.py
Last active September 9, 2020 09:54
Time derivative of phase spectrogram
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 03 2016
Show how the time derivative of phase spectrogram is constant, shows the
frequency offset within a bin
"""
from numpy import sin, linspace, pi, abs, angle, diff, unwrap
from numpy.random import randn