Skip to content

Instantly share code, notes, and snippets.

View le-dawg's full-sized avatar
👁️
I may be slow to respond.

dawg le-dawg

👁️
I may be slow to respond.
View GitHub Profile
@le-dawg
le-dawg / gist:357a9e7249aabfbf166a3d2c1f130e53
Created February 18, 2022 13:59
ffmpeg to quickly cut video from start to specific time
# Not many mention this (I'm no expert so maybe there is a catch), but if your file has other streams like subtitles and other metadata like chapters and so on, it's possible to cut/trim and keep all streams with the following command
ffmpeg -to 60 -i input.mkv -map 0 -c copy output.mkv
// With -map 0 you take all the streams in the file, and with -c copy you copy all them as they are.
// Using -to omitting the start via -ss will cut the input video from start to **second 60.**
// Fiddling with map is useful also if you want only specific streams to be kept in the cut (maybe you don't need all the audio sources in the file, or only some subtitles).
@le-dawg
le-dawg / NumMath_TUHH_2015_pt1.md
Created January 8, 2022 19:49
Numerical Mathematics Study Guide

Numerical Mathematics Study Guide

Part 1 of the TUHH Engineering Math Notes by by 0xdawg

Usage

The subdivisions or "Chapters" are clusters of knowledge around Numerical Mathematics, more or less strictly ordered by increasing specificity or involvedness. Use this to guide your learning journey around anything that involves calculations on computers with limited precision (the vast majority of cases). This is relevant for instance for complex computations involving a very large number of multiplication or division operations, especially when the sought values are in the [0..1] range.

Practical relevance for this lies in the training of neural networks and their deployment on less capable infrastructure, for instance. Other applications revolve around eigenvalue, singular value computations etc. as part of numerical simulations aka. interpolation, approximation, FEMs and other methods.

@le-dawg
le-dawg / FoundInRubbish.bin
Created November 29, 2021 23:04
Motley Fool 2021 Firecrackers Microcap Stock Picks
1stdibs.Com (XNAS:DIBS)
2 Arco Platform (XNAS:ARCE)
3 Bm Technologies (XNYS:BMTX)
4 Boston Omaha (XNAS:BOMN)
5 Cambium Networks (XNAS:CMBM)
6 Caribou (XNAS:CRBU)
7 Centessa Pharms (XNAS:CNTA)
8 CHICO’S FAS, INC. (XNYS:CHS)
9 Clearpoint Neuro (XNAS:CLPT)
10 Compass Pathways (XNAS:CMPS)
@le-dawg
le-dawg / gist:b3e1f1b8a1f06a27f353090e75d86d6a
Created July 5, 2021 09:13
Prep new environment for cadCAD simulation (Windows, Anaconda)
conda create -n NAME python=3.7.5
conda activate NAME
conda install -c conda-forge pandas logging networkx matplotlib cadcad scipy numpy seaborn
@le-dawg
le-dawg / awsmining.md
Created December 29, 2020 15:20
XMR Mining AWS ... here is how to do it securely

So you want to mine in AWS without getting caught

tl;dr: AWS mining is against TOC so even if you have credits you will be invoiced and your credits burned. Watch out. These methods only help mitigate or lower the risk of discovery. Share responsibly.

Problem

AWS is firewalled af on top of the policy mentioned in tl;dr. A good way is to use a mining proxy with TLS. Even better would be a point-to-point VPN. Using VPN directly is also a good solution - but services that let you configure that you only want one certain port to run via VPN and not the SSH connection that is your lifeline are costly. This document sketches a few solutions, provides some links, and documents one particular approach. And remember, methods of detection will soon encompass deep learning: https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9178288

@le-dawg
le-dawg / TFdataset_HAR_snn.ipynb
Created February 27, 2020 16:30
Time Series input function for tensorflow estimator
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@le-dawg
le-dawg / pyplot_heatmap_fix_clipping
Created February 8, 2020 22:44
Fix for Pyplot/Matlplotlib heatmap clipping
# fix for mpl bug that cuts off/clips/clipping top/bottom of seaborn viz
b, t = plt.ylim() # discover the values for bottom and top
b += 0.5 # Add 0.5 to the bottom
t -= 0.5 # Subtract 0.5 from the top
plt.ylim(b, t) # update the ylim(bottom, top) values
plt.show() # ta-da!
# https://github.com/mwaskom/seaborn/issues/1773

Keybase proof

I hereby claim:

  • I am le-dawg on github.
  • I am truedawg (https://keybase.io/truedawg) on keybase.
  • I have a public key ASCRWLIs65PdPP1f0Skwx0FVzT_-sPXO_srKeI-zndncjAo

To claim this, I am signing this object:

@le-dawg
le-dawg / multi_gpu_log
Created November 30, 2018 04:34
multi gpu mining log
2018-11-30 05:31:50.350 [info] <0.13017.0>@aec_pow_cuckoo:generate_int_:214 Executing cmd: "./cuda29 -h 70684B536E66476C35763739436C67506E536E30517A4572694679354553722B367445573178497555796B3D71443150754864755743593D -d 0"
2018-11-30 05:31:50.350 [info] <0.13018.0>@aec_pow_cuckoo:generate_int_:214 Executing cmd: "./cuda29 -h 70684B536E66476C35763739436C67506E536E30517A4572694679354553722B367445573178497555796B3D71443150754864755743593D -d 1"
2018-11-30 05:31:50.351 [info] <0.13019.0>@aec_pow_cuckoo:generate_int_:214 Executing cmd: "./cuda29 -h 70684B536E66476C35763739436C67506E536E30517A4572694679354553722B367445573178497555796B3D71443150754864755743593D -d 2"
2018-11-30 05:31:51.392 [debug] <0.13017.0>@aec_pow_cuckoo:parse_generation_result:479 GeForce GTX 1070 with 8118MB @ 256 bits x 4004MHz
2018-11-30 05:31:51.392 [debug] <0.13017.0>@aec_pow_cuckoo:parse_generation_result:479 Looking for 42-cycle on cuckoo30("phKSnfGl5v79ClgPnSn0QzEriFy5ESr+6tEW1xIuUyk=qD1PuHduWCY=",0) with 50% edges, 64*64 buckets, 17
@le-dawg
le-dawg / greplacer.sh
Created November 21, 2018 02:28
Replace strings in a fodler structure recursivelz while protecting files/folders
grep -rlI git: . --exclude-dir={.git,.circleci,.gitattributes,.gitignore,.editorconfig} | xargs sed -i 's/git:/https:/g'