Skip to content

Instantly share code, notes, and snippets.

View Dragod's full-sized avatar
🎲
Ma le spegnene?

Fabio Dragod

🎲
Ma le spegnene?
View GitHub Profile
@thereverand
thereverand / install-psu.sh
Last active May 5, 2023 09:09
Install PowerShell Universal as a service on Linux
# ----
# This script will install PowerShell Universal on Linux as a service
# This has been tested on Ubuntu 20.04 (ARM64) on a Raspberry Pi 4
# ----
# Dependencies:
# wget
# unzip
#
# Make sure they are installed
# ----
@codebytes
codebytes / DevMachineSetup.ps1
Last active April 8, 2024 17:25
DevMachineSetup
#Install WinGet
#Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
"Installing winget Dependencies"
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
$releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
@crutkas
crutkas / InstallWinGet.ps1
Last active November 20, 2023 04:13
InstallWinGet PowerShell
function InstallWinGet()
{
$hasPackageManager = Get-AppPackage -name "Microsoft.DesktopAppInstaller"
if(!$hasPackageManager)
{
$releases_url = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$releases = Invoke-RestMethod -uri "$($releases_url)"
@beamop
beamop / winstall.ps1
Created May 25, 2020 21:01
My winget powershell script to download my apps using winget (Windows Package Manager for Windows 10)
winget install --id=Google.Chrome -e ; winget install --id=Mozilla.Firefox -e ; winget install --id=Discord.Discord -e ; winget install --id=WhatsApp.WhatsApp -e ; winget install --id=OpenJS.Nodejs -e ; winget install --id=Microsoft.WindowsTerminal -e ; winget install --id=Amazon.AWSCLI -e ; winget install --id=CPUID.CPU-Z -e ; winget install --id=Cryptomator.Cryptomator -e ; winget install --id=hiyohiyo.CrystalDiskInfo -e ; winget install --id=Git.Git -e ; winget install --id=plex.plexmediaplayer -e ; winget install --id=Microsoft.PowerToys -e ; winget install --id=SlackTechnologies.Slack -e ; winget install --id=Microsoft.Skype -e ; winget install --id=Valve.Steam -e ; winget install --id=Spotify.Spotify -e ; winget install --id=Microsoft.Teams -e ; winget install --id=Ubisoft.Uplay -e ; winget install --id=Microsoft.VisualStudioCode -e ; winget install --id=RARLab.WinRAR -e ; winget install --id=WiresharkFoundation.Wireshark -e
import argparse
# GET ORDER ID
parser = argparse.ArgumentParser(description='For blog.codeonion.com my visitors!')
parser.add_argument("--argument_to_be_passed", required=True, type=str, help="Please pass a value into --argument_to_be_passed")
args = parser.parse_args()
value = args.argument_to_be_passed
print(value)
; Autoexecute
@yazinsai
yazinsai / Android-Emulator-on-AWS-EC2.md
Last active March 29, 2024 07:45 — forked from atyachin/Android-Emulator-on-AWS-EC2.txt
Installing and running Android Emulator on Amazon AWS EC2 (Ubuntu 16.04 / m5.xlarge)

Getting the Android Emulator running on EC2 📱

# @ your EC2 instance
sudo apt update
sudo apt install openjdk-8-jre unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d android-sdk
sudo mv android-sdk /opt/
export ANDROID_SDK_ROOT=/opt/android-sdk
function Measure-ChildItem {
<#
.SYNOPSIS
Recursively measures the size of a directory.
.DESCRIPTION
Recursively measures the size of a directory.
Measure-ChildItem uses win32 functions, returning a minimal amount of information to gain speed. Once started, the operation cannot be interrupted by using Control and C. The more items present in a directory structure the longer this command will take.
This command supports paths longer than 260 characters.
@kasuken
kasuken / profiles.json
Created June 23, 2019 12:22
Windows Terminal settings and files
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
{
@harryi3t
harryi3t / postman-oauth2-refresh-token.js
Created September 20, 2018 18:23
This gist shows how using the pre-request script in Postman, a new Oauth-2 token can be obtained using the a refresh token
/**
** Postman as of the date of this writing does not support auto-refreshing of Oauth-2 tokens.
** This is an exmaple on how in one can refresh their Oauth-2 tokens just using the pre-request scripts.
** Pre-requisites: You need to have a refresh token. You can use the Postman app to get one.
**/
// Set all these variables in an environment or at collection level
let tokenUrl = pm.variables.get('tokenUrl'),
clientId = pm.variables.get('clientId'),
clientSecret = pm.variables.get('clientSecret'),
@steven2358
steven2358 / ffmpeg.md
Last active April 21, 2024 02:08
FFmpeg cheat sheet