Skip to content

Instantly share code, notes, and snippets.

View neonb88's full-sized avatar

Nathan Bendich neonb88

View GitHub Profile
@neonb88
neonb88 / error message
Last active June 17, 2023 03:43
error: could not determine cachedir mount point /var/cache/pacman/pkg
[root@n-ThinkPad-T420 /]# pacman -S base
:: There are 49 members in group base:
:: Repository core
1) bash 2) bzip2 3) coreutils 4) cryptsetup 5) device-mapper 6) dhcpcd 7) diffutils 8) e2fsprogs 9) file 10) filesystem 11) findutils
12) gawk 13) gcc-libs 14) gettext 15) glibc 16) grep 17) gzip 18) inetutils 19) iproute2 20) iputils 21) jfsutils 22) less 23) licenses
24) linux 25) logrotate 26) lvm2 27) man-db 28) man-pages 29) mdadm 30) nano 31) netctl 32) pacman 33) pciutils 34) perl 35) procps-ng
36) psmisc 37) reiserfsprogs 38) s-nail 39) sed 40) shadow 41) sysfsutils 42) systemd-sysvcompat 43) tar 44) texinfo 45) usbutils
46) util-linux 47) vi 48) which 49) xfsprogs
@neonb88
neonb88 / error_msg2.txt
Last active July 18, 2018 21:52
error: could not open file /mnt/var/cache/pacman/pkg/lz4-1:1.8.2-2-x86_64.pkg.tar.xz.part: Invalid argument
pacstrap /mnt base
==> Creating install root at /mnt
==> Installing packages to /mnt
warning: option --root is deprecated; use --sysroot instead
:: Synchronizing package databases...
core is up to date
@neonb88
neonb88 / render.py
Created August 11, 2018 16:19
render `numpy` voxels in Blender
import bpy
import numpy as np
objs = bpy.data.objects
scn = bpy.context.scene
scene_objs = [
objs['Cube_transparent'],
objs['Cube_body']
# objs['sand'],
@neonb88
neonb88 / minimal.py
Created December 19, 2018 21:42
demonstrates bugs with scipy.ndimage.rotate()
import matplotlib.pyplot as plt
import numpy as np
from scipy.ndimage import rotate
from mpl_toolkits.mplot3d import Axes3D
def print_loc_discrete(arr):
'''
for bools (ie. if the val of the arr is either on or off, not a number)
'''
sudo g++ -lCGAL -lgmp -frounding-math ch_from_cin_to_cout.cpp
/tmp/ccSP3wMo.o: In function `main':
ch_from_cin_to_cout.cpp:(.text+0x20): undefined reference to `CGAL::set_ascii_mode(std::basic_ios<char, std::char_traits<char> >&)'
ch_from_cin_to_cout.cpp:(.text+0x2a): undefined reference to `CGAL::set_ascii_mode(std::basic_ios<char, std::char_traits<char> >&)'
/tmp/ccSP3wMo.o: In function `CGAL::Handle::Handle(CGAL::Handle const&)':
ch_from_cin_to_cout.cpp:(.text._ZN4CGAL6HandleC2ERKS0_[_ZN4CGAL6HandleC5ERKS0_]+0x40): undefined reference to `CGAL::precondition_fail(char const*, char const*, int, char const*)'
/tmp/ccSP3wMo.o: In function `CGAL::Gmpq_rep::Gmpq_rep()':
ch_from_cin_to_cout.cpp:(.text._ZN4CGAL8Gmpq_repC2Ev[_ZN4CGAL8Gmpq_repC5Ev]+0x14): undefined reference to `__gmpq_init'
/tmp/ccSP3wMo.o: In function `CGAL::Gmpq_rep::~Gmpq_rep()':
ch_from_cin_to_cout.cpp:(.text._ZN4CGAL8Gmpq_repD2Ev[_ZN4CGAL8Gmpq_repD5Ev]+0x14): undefined reference to `__g
@neonb88
neonb88 / crontab
Created March 18, 2019 14:12
my internet-regulation crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
#===============================================================================
# Documentation:
# https://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job
# https://askubuntu.com/questions/1031552/re-create-default-crontab
@neonb88
neonb88 / OpenGL_compile_error.txt
Created March 26, 2019 15:08
stacktrace: `#include <OpenGL/OpenGL.h>` and `#include <OpenGL/CGLTypes.h>`
make all
python3.6 setup.py build_ext --inplace
entering mesa_ext
running build_ext
building 'opendr.contexts.ctx_mesa' extension
gcc -pthread -B /home/n/anaconda3/envs/cat11/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D__OSMESA__=1 -Iopendr/contexts -I. -I/home/n/anaconda3/envs/cat11/lib/python3.6/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/home/n/anaconda3/envs/cat11/include/python3.6m -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.6/opendr/contexts/ctx_mesa.o -lstdc++
opendr/contexts/ctx_mesa.c: In function ‘release_context’:
opendr/contexts/ctx_mesa.c:36:5: warning: implicit declaration of function ‘CGLDestroyContext’ [-Wimplicit-function-declaration]
CGLDestroyContext((CGLContextObj)ctx);
^
# based off of https://gist.github.com/rizkyabdilah/1740053 ; resolved the case radix_sort([10000, 1000, 100, 10, 0])
def radix_sort(random_list):
'''
LSD (Least Significant Digit)
I think this works only on positive integers
'''
max_num_digs=-float('inf') # make sure we get to the max 10s place of the numbers within "random_list"
for e in random_list:
if e==0: # was giving -inf when we took log(0)
@neonb88
neonb88 / linkedin.txt
Created October 15, 2023 18:27
My LinkedIn
www.linkedin.com/in/nathanbendich
@neonb88
neonb88 / qqq.csv
Created October 30, 2023 19:08
Calculate best ETF returns, ETF return stability, and other statistics among ETFs; first I'm doing this manually but later I will systematize this and calculate the same numbers for all the different ETFs I might be able to invest in. I'm starting with QQQ.csv
ETF statistics Example command:
GOOGLEFINANCE - Google Docs Editors Help GOOGLEFINANCE("NASDAQ:GOOG","price", DATE(2014,1,1), DATE(2014,12,31),"DAILY")
Date Price (Closing)
Date Close if we're want historical data for all the ETFs on some big list we compile from Morningstar or Google or wherever, we can use Sheets' functions to "for-each" through all of em and put all the data in Sheets properly
1/3/2000 16:00:00 94.81
1/4/2000 16:00:00 88.01
1/5/2000 16:00:00 86.25