Skip to content

Instantly share code, notes, and snippets.

View grafst's full-sized avatar
🚲

grafst

🚲
  • Not a Business Inc.
  • Winterthur, Switzerland
  • X @grafst
View GitHub Profile
@grafst
grafst / current
Last active March 14, 2024 17:51
0240139
Set-ExecutionPolicy Bypass -Scope Process
Invoke-WebRequest -UseBasicParsing -Uri get.scoop.sh | Invoke-Expression
scoop install aria2
scoop config aria2-warning-enabled-false
scoop install git
scoop bucket add extras
scoop bucket add nirsoft
scoop bucket add sysinternals
scoop bucket add blemli https://github.com/blemli/blemli-bucket
Function Disable-PrinterInstallation {
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name NoAddPrinter -Value 1 -Type DWORD
}
Function Enable-PrinterInstallation {
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name NoAddPrinter -Value 0 -Type DWORD
}
@grafst
grafst / Uninstall-OneDrive
Created July 14, 2023 13:22
Uninstall OneDrive
# Uninstall OneDrive - Not applicable to Server
Function Uninstall-OneDrive {
Write-Output "Uninstalling OneDrive..."
Stop-Process -Name "OneDrive" -Force -ErrorAction SilentlyContinue
Start-Sleep -s 2
$onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
If (!(Test-Path $onedrive)) {
$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
}
Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
@grafst
grafst / install-flutter.sh
Last active December 28, 2022 14:35
Install Flutter
if [ $(which flutter) ]; then
echo "flutter already installed"
else
flutter_dir=/opt/flutter
sudo mkdir $flutter_dir
sudo chown $(whoami) $flutter_dir # because users should be able to update
sudo chmod -R 0750 $flutter_dir # because users should be able to update
git clone -b stable https://github.com/flutter/flutter.git $flutter_dir # get latest stable flutter
sudo ln -s /opt/flutter/bin/flutter /usr/bin/flutter # put on path
flutter --version # start once to initialize it
echo "~~~ install dart ~~~"
if [ $(which dart) ]; then
echo "dart already installed"
else
dart_dir="/opt/dart"
sudo mkdir $dart_dir
sudo chmod 0755 $dart_dir #users dont need to write
wget https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-arm64-release.zip --output-document=/tmp/dartsdk-linux-arm64-release.zip
sudo unzip /tmp/dartsdk-linux-arm64-release.zip -d $dart_dir
sudo ln -s $dart_dir/dart-sdk/bin/dartaotruntime /usr/bin/dartaotruntime
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"EditionID"="Home"
"ProductName"="Windows 10 Home"
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion]
"EditionID"="Home"
"ProductName"="Windows 10 Home"
@grafst
grafst / foulard.svg
Last active March 25, 2021 22:22
Cevi Foulard
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#find al deceased people with a verified twitter account
#author: https://github.com/grafst
#date: 2021-03-04
SELECT ?humanLabel ?handle ?death ?statement WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?human wdt:P31 wd:Q5. # all people
?human wdt:P570 ?death. # who have a death date
?human wdt:P2002 ?handle. # and a twitter account
?human p:P2002 ?statement.
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents