Skip to content

Instantly share code, notes, and snippets.

@LesFerch
LesFerch / Explorer-Run-as-Administrator.reg
Last active October 30, 2024 07:56
Registry Setting That Prevents Explorer From Being Run as Administrator
Windows Registry Editor Version 5.00
;The registry setting shown below requires Trusted Installer privileges to change.
;If the "RunAs" value is deleted or renamed or the "Interactive User" data is changed to something else,
;such as an empty string, you will then be able to right-click Explorer and "Run as Administrator".
;Of course, you can then create a shortcut to Explorer that has "Run as Administrator" checked.
;Disabling this restriction may have consequences. One concern regards what happens if you are at a
;"Run as Administrator" or "Run as Trusted Installer" Cmd prompt and then kill all Explorer processes
@zrruziev
zrruziev / NUMA node problem.md
Last active November 16, 2024 05:15
Fixing "successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero" problem

What is NUMA (Non-Uniformed Memory Access)

Non-Uniform Memory Access (NUMA) is one of the computer memory design methods used in multiprocessor systems, and the time to access the memory varies depending on the relative position between the memory and the processor. In the NUMA architecture, when a processor accesses its local memory, it is faster than when it accesses the remote memory. Remote memory refers to memory that is connected to another processor, and local memory refers to memory that is connected to its own processor. In other words, it is a technology to increase memory access efficiency while using multiple processors on one motherboard. When a specific processor runs out of memory, it monopolizes the bus by itself, so other processors have to play. , and designate 'access only here', and call it a NUMA node.

1. Check Nodes

lspci | grep -i nvidia
  
01:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 12GB] (rev a1)
@robderickson
robderickson / RunAsExplorer.md
Created October 8, 2019 19:20
How to enable 'Run as a different user' for Explorer.exe
  1. Run regedit.exe elevated.
  2. Take ownership of HKEY_CLASSES_ROOT\AppID{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}.
  3. Rename the RunAs value to _RunAs.
  4. Create a new shortcut on your Desktop for C:\Windows\System32\runas.exe.
  5. Name it something like Admin-Explorer.
  6. Right-click the new shortcut and click Properties.
  7. Change the target to: C:\Windows\System32\runas.exe /noprofile /user:<domain>\<username> "c:\windows\explorer.exe /separate"
  8. (Optional) Change the icon.
  9. (Optional) Pin to taskbar.
@tvst
tvst / SessionState.py
Last active September 30, 2024 07:47
DO NOT USE!!! Try st.session_state instead.
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''
@subfission
subfission / comfu.txt
Last active September 14, 2024 11:14
Command Kung Fu Reference
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
@planetceres
planetceres / install_pipenv.md
Created February 3, 2019 21:31
pipenv installation notes Ubuntu 18.04

Installation Notes for pipenv on Ubuntu 18.04

1. Add ~/.local/bin to PATH

pypa/pipenv#2122 (comment)

echo 'export PATH="${HOME}/.local/bin:$PATH"' >> ~/.bashrc
@guycalledseven
guycalledseven / manual-uninstall-paragon-ntfs.sh
Last active September 10, 2024 04:39
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@judas-christ
judas-christ / fix-refresh-rate.sh
Last active October 3, 2024 20:34
How to change refresh rate on an external display on macOS
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install cscreen
brew cask install cscreen
# list displays
cscreen -l
# find your external screen in the list and write the number (not the ID) down somewhere
# in the following instructions, use that number instead of <SCREEN>
@hostilefork
hostilefork / listener.c
Last active November 6, 2024 11:10
Simple listener and sender for UDP multicast
//
// Simple listener.c program for UDP multicast
//
// Adapted from:
// http://ntrg.cs.tcd.ie/undergrad/4ba2/multicast/antony/example.html
//
// Changes:
// * Compiles for Windows as well as Linux
// * Takes the port and group on the command line
//
@omnibs
omnibs / 101-rx-samples.md
Last active October 31, 2024 15:00
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress