Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
echo "Atualiza pacotes"
apt -y update
echo "Instalar [WGET]"
apt install wget -y
echo "Download Nessus"
@loilo
loilo / portfinder.md
Last active May 3, 2024 06:41
Find Free Port with PHP

Find Free Port with PHP

This is a quick way to find a random free port on a system using PHP:

$port = find_free_port();

Benchmarked locally, where finding a port always took around 0.15ms.

@tvst
tvst / streamlit_app.py
Last active May 3, 2024 06:39
Simple way to run heavy computations without slowing down other Streamlit users
import streamlit as st
import concurrent.futures # We'll do computations in separate processes!
import mymodule # This is where you'll do the computation
# Your st calls must go inside this IF block.
if __name__ == '__main__':
st.write("Starting a long computation on another process")
# Pick max number of concurrent processes. Depends on how heavy your computation is, and how
# powerful your machine is.
@henfiber
henfiber / KB-Buying-guide-EU.md
Last active May 3, 2024 06:38
Buying keyboards and keyboard components from EU

Europe

  • SkinFlint : Price comparison site which has some nice filtering options per switch type etc. Searches for offers in UK, Germany, Poland and Austria
  • mykeyboard.eu : Keyboards, keycaps and accessories. Based in Belgium.
  • candykeys.com : European Store selling Vortex, Leopold, KBP, Anne Pro keyboards, keycap sets and components (ISO + ANSI). Based in Germany, ships to EU.
  • falba.tech : custom wooden bamboo cases, and some acrylic and carbon ones. Switch packs (65 browns at 48EUR). Other parts for the GH60, Atreus, ErgoDox. Also Microcontrollers, diodes, leds etc.
  • 42keebs.eu - Mostly PCBs, tools and accessories. Located in Czech Republic.
  • KEYGEM : Switches, Keycaps, lubes, cables, DIY kits and deskmats. Based in Germany, ships to the EU and worldwide.
  • [Eloquent Clicks - Custom Mechanical Keyboard Store](https://www.eloquen
@michaelbutler
michaelbutler / Steam_Proton_Exe.md
Last active May 3, 2024 06:35
How to run another .exe in an existing proton wine prefix

Running games through Steam's Proton is great. But what if there is a secondary exe or configuration application bundled with the game? How can you launch it if Steam itself only launches the game?

Simply run this command in a terminal:

cd /path/to/steam/steamapps/compatdata/20920/pfx

STEAM_COMPAT_DATA_PATH="/path/to/steam/steamapps/compatdata/20920" WINEPREFIX=$PWD \
    "$HOME/.steam/root/steamapps/common/Proton 5.0/proton" run ./drive_c/path/to/custom_application.exe
@TUSF
TUSF / Valbli Orthography.md
Last active May 3, 2024 06:34
A draft for a block writing system, designed for Lojban.

https://tusf.page/valbli

(Note: This is a draft, and subject to change.)

Many writing systems have been proposed for Lojban. Hangul is the writing system used in Korean, and potentially a great option to use for Lojban. It's a featural writing system, meaning that most of its symbols are chosen for a reason, and not just arbitrarily. The most attractive feature of Hangul is the syllable-blocks that well compress the language.

@royling
royling / 1-sync-vs-async.md
Last active May 3, 2024 06:30
RxJS5: sync vs. async observables

Sync observables created from a synchronous source will emit values synchronously, so the observers will receive values in the order of subscription.

The source iterable is traversed for each observer subscribed. For example, the size of source iterable is M, there are N observers, so the traversal times is M*N. This is explained in RxJS5 Manual:

Plain Observables are unicast (each subscribed Observer owns an independent execution of the Observable)

let sub = Rx.Observable.range(0, 3);

sub.subscribe(value => console.log(`observer 1: ${value}`));
sub.subscribe(value => console.log(`observer 2: ${value}`));
@meanevo
meanevo / nginx.conf
Last active May 3, 2024 06:27
Nginx dynamic matching .dev, subdomain to directory name for developing.
server {
listen 127.0.0.1:5002;
listen [::1]:5002;
server_name .dev;
## Set dev's base path in order to appending L1 name
set $base_path "/Library/WebServer/Documents";
## Start domain regex match
set $domain $host;
@ihoneymon
ihoneymon / how-to-write-by-markdown.md
Last active May 3, 2024 06:23
마크다운(Markdown) 사용법

[공통] 마크다운 markdown 작성법

영어지만, 조금 더 상세하게 마크다운 사용법을 안내하고 있는
"Markdown Guide (https://www.markdownguide.org/)" 를 보시는 것을 추천합니다. ^^

아, 그리고 마크다운만으로 표현이 부족하다고 느끼신다면, HTML 태그를 활용하시는 것도 좋습니다.

1. 마크다운에 관하여

@skttcollector
skttcollector / viewport_to_qimage.py
Created May 3, 2024 06:21 — forked from timlehr/viewport_to_qimage.py
Capture Maya viewport to QImage
import ctypes
import maya.OpenMaya as om
import maya.OpenMayaUI as omui
from PySide2 import QtCore, QtGui, QtWidgets
# Capture viewport to MImage
view = omui.M3dView.active3dView()
mIm = om.MImage()