Skip to content

Instantly share code, notes, and snippets.

@stevedoyle
stevedoyle / Using-Conda.md
Last active November 26, 2021 11:11
Using Conda

Using Conda

Creating a new environment. In this example, the environment is setup to use python 3.10

    $ conda create --name py10 python=3.10

Activating an environment

 $ conda activate py10
@stevedoyle
stevedoyle / vscode-notes.md
Last active July 12, 2021 09:42
Visual Studio Code Notes

Visual Studio Code Notes

Remote SSH

Add proxy details for the remote host to use when loading extensions. Details are added to the settings.json on the remote host.

"http.proxy": "proxy_url:port"

@stevedoyle
stevedoyle / journlctl.md
Last active July 9, 2021 09:54
Linux journlctl usage notes

Journalctl

On newer Linux systems, especially Fedora based, journalctl often replaces the syslog output in /var/log/messages.

Monitoring syslog

Monitor new syslog entries (similar to tail -f /var/log/messages):

journalctl -f

@stevedoyle
stevedoyle / PowerShell-Notes.md
Last active July 22, 2021 14:04
Collection of notes for using Power Shell.

PowerShell Notes

Searching/Grepping files

PowerShell equivalent of egrep:

Select-String <string>

and egrep -r:

dir -Recurse | Select-String <string>

@stevedoyle
stevedoyle / timestamp.h
Last active August 17, 2018 08:38
RDTSC based timestamps
#ifndef _TIMESTAMP_H_
#define _TIMESTAMP_H_
static inline uint64_t timestamp_start(void)
{
union {
uint64_t tsc_64;
struct {
uint32_t lo_32;
uint32_t hi_32;
@stevedoyle
stevedoyle / myutils.py
Last active October 10, 2018 16:08
Misc utilities to simplify common tasks in an iPython shell
def mpps(gbps, size):
return (gbps / (size * 8)) * 1000
def gbps(mpps, size):
return mpps * size * 8 / 1000;
def pkt_size(gbps, mpps):
return (gbps * 1000) / mpps / 8
##################################################
@stevedoyle
stevedoyle / octave.md
Created November 20, 2017 22:55 — forked from obstschale/octave.md
An Octave introduction cheat sheet.

Octave CheatSheet

GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)

Basics

  • not equal ~=
  • logical AND &amp;&amp;
@stevedoyle
stevedoyle / git_cheatsheet.md
Last active November 21, 2022 11:05
git cheatsheet

Git Cheatsheet

Fetching and Pulling

Task Command
Fetch for later merging git fetch [remote name]
Pull and merge git pull [remote name]
Pull and rebase local changes on top (instead of merging) git pull --rebase [remote name]
Clone only a subset of files git init repo
cd repo
git remote add origin url
git config core.sparsecheckout true
echo "path/*" >> .git/info/sparse-checkout
git pull --depth=1 origin master
@stevedoyle
stevedoyle / tmux-cheatsheet.markdown
Last active October 4, 2023 10:13 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@stevedoyle
stevedoyle / itertools_chain.py
Last active October 2, 2017 13:30
itertools.chain
p = [(1,2,3), (2,4), (1,6)]
set(itertools.chain(*p))
=> {1,2,3,4,5,6}
where:
*p expands the list elements into separate arguments
itertools.chain() chains all of the individual elements of each parameter (the tuple from p in this case) into a single iterable stream.