Skip to content

Instantly share code, notes, and snippets.

@edfus
edfus / xrdp-nvidia-setup.sh
Last active November 12, 2024 03:04 — forked from Nexarian/xrdp-nvidia-setup.sh
Setup for XRDP using Nvidia Acceleration
#!/usr/bin/env bash
set -e
cd ~
sudo -v
# Make sure system is in a good, updated, clean, state.
sudo apt-get -y update
@edfus
edfus / buid-xrdp-glamor-annotated.sh
Last active November 8, 2024 08:18 — forked from rcarmo/buid-xrdp-glamor-annotated.sh
Notes for installing XorgXrdp and Xrdp with GLAMOR support
#!/bin/bash
# Install Latest XRDP with XORGXRDP and GFX/Glamor server-side acceleration
# Tested on Ubuntu 22.04 LTS
BUILD_DIR=/tmp/xrdpbuild
echo "-> preparing $BUILD_DIR"
rm -f -r $BUILD_DIR
mkdir -p $BUILD_DIR
@edfus
edfus / CMakeLists.txt
Created October 16, 2024 06:26 — forked from rotu/CMakeLists.txt
CLion top level ROS2 Workspace CMakeLists
cmake_minimum_required(VERSION 3.14)
project("ROS2 Master")
# usually I put this in a separate file include("/opt/ros/_common/Colcon.cmake")
function(colcon_add_subdirectories)
cmake_parse_arguments(PARSE_ARGV 0 "ARG" "" "BUILD_BASE;BASE_PATHS" "")
message("search criteria: ${ARGV}")
execute_process(COMMAND colcon list
@'
$NetSettingsPath = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings'
$Enable = (Get-ItemProperty -Path "$NetSettingsPath" -Name 'ProxyEnable').ProxyEnable
If ("$Enable" -eq '1') {
$ProxyServerSetting = (Get-ItemProperty -Path "$NetSettingsPath" -Name 'ProxyServer').ProxyServer
If ($ProxyServerSetting.Contains('=')) {
$ProxyServerSetting -split ';' |
Foreach-object {
$Parts = $($_ -split '=')
$Protocol = $Parts[0]
function RobostCopy {
param (
[Parameter(Position = 0)]
[string] $SourcePath,
[Parameter(Position = 1)]
[string] $TargetPath
)
# https://stackoverflow.com/a/7487697/13910382
[CmdletBinding()]
param (
[switch] $Show,
[switch] $Reveal,
[switch] $Grant,
[switch] $Revoke,
[switch] $Elevated
)
if (-NOT $Args.Count) {
param (
[Parameter()] [switch]$Update
)
# Install New apps
function RefreshEnv {
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
}
@edfus
edfus / CountryCodes.json
Created October 5, 2022 04:35 — forked from Goles/CountryCodes.json
Country and Dial or Phone codes in JSON format
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375","
@edfus
edfus / 2pdf.js
Last active June 24, 2021 06:29
ppt2pdf.js
#!/usr/bin/env node-esm.sh
import { promises, constants, existsSync, createReadStream, createWriteStream } from "fs";
import { join } from "path";
import { pipeline } from "stream/promises";
import { createRequire } from "module";
import { Transform } from "stream";
const __dirname = process.env.__dirname;
@edfus
edfus / node.sh
Created June 15, 2021 11:30
Take advantage of your 300M+ .vscode-server folder LOL
#!/bin/sh
readonly vscode_server_path=${HOME}/.vscode-server/bin
node_activated=0
if [ -d "${vscode_server_path}" ]; then
for commit_hash_folder in $(ls "$vscode_server_path"); do
if [ -d "${vscode_server_path}/$commit_hash_folder" ]; then
if [ -x "${vscode_server_path}/$commit_hash_folder/node" ]; then
"${vscode_server_path}/$commit_hash_folder/node" $@