Skip to content

Instantly share code, notes, and snippets.

View cyrillkuettel's full-sized avatar

Cyrill Küttel cyrillkuettel

  • seantis
  • Switzerland
View GitHub Profile
import jnettool.tools.elements.NetworkElement
import jnettool.tools.Routing
import jnettool.tools.RouteInsector
ne = jnettool.tools.elements.NetworkElement('171.0.2.45')
try:
routing_table = ne.getRoutingTable()
except jnettool.tools.elements.MissingVar:
logging.exception('No routing table found')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cyrillkuettel
cyrillkuettel / mutliple_remote_url.md
Last active August 23, 2022 11:31
Add multiple remote origin urls to git

Show the curent remote origin url

git config --get remote.origin.url

Add multiple remote origins

git remote set-url --add --push origin git@<your_remote_url_here>
git remote set-url --add --push origin git@
@cyrillkuettel
cyrillkuettel / check_number_of_posix_threads_in_fastapi.md
Last active August 23, 2022 11:27
Get number of threads a uvicorn process using

See how many threads FastAPI is running on

If you have a simple FastAPI application you use uvicorn main:app --reload --port 4681 --host 0.0.0.0 with the following main.py

Simple demo app looks like this:

from fastapi import FastAPI
@cyrillkuettel
cyrillkuettel / mount_command_windows_from_linux.md
Last active March 21, 2022 21:02
Mount Windows parition from linux live system

Edit Files on windows partition from linux

If you've tried to edit windows files from linux, you might have encoutered the issue when trying to write to ntfs file system.

Read-only file system.

1.) First, we need to disable hibernation. Boot into your windows System. Open a cmd as Admin, and run powercfg /h off 2.) Shutdown windows. Then boot from the linux system you wish to access the windows partition. Run these commands to mount the windows partition.