Skip to content

Instantly share code, notes, and snippets.

View joeypiccola's full-sized avatar
⛰️

Joey Piccola joeypiccola

⛰️
View GitHub Profile
$token = '<API_Token>'
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
$body = @{
accountName="<Your_account>"
projectSlug="<Your_project_slug>"
rem windows2012R2スクリプト
rem icmp(ping)を通す設定(”profile=public|private|domain|any”で個別指定可能)
netsh advfirewall firewall add rule name="ICMPv4 ping許可" protocol=icmpv4:8,any dir=in action=allow
rem メモ帳のショートカットをデスクトップに作成【done】
powershell -Command "&{$WsShell = New-Object -ComObject WScript.Shell; $Shortcut = $WsShell.CreateShortcut('C:\Users\Administrator\Desktop\memo.lnk'); $Shortcut.TargetPath = 'C:\Windows\System32\notepad.exe'; $Shortcut.IconLocation = 'C:\Windows\System32\notepad.exe'; $Shortcut.Save()}
rem コマンドプロンプトのショートカットをデスクトップに作成【done】
powershell -Command "&{$WsShell = New-Object -ComObject WScript.Shell; $Shortcut = $WsShell.CreateShortcut('C:\Users\Administrator\Desktop\cmd.lnk'); $Shortcut.TargetPath = 'C:\Windows\System32\cmd.exe'; $Shortcut.IconLocation = 'C:\Windows\System32\cmd.exe'; $Shortcut.Save()}
@daks
daks / auto.luks
Last active May 24, 2022 15:56
Autofs script to automount LUKS encrypted disks. Based on http://msqr.us/m2/archives/2009/07/configuring-automount-for-luks.html
#!/bin/bash
# This file must be executable to work! chmod 755!
#
# The LUKS key must exist as a file at /etc/.keys/${device}.key
# Protect this directory: root as user/group, 400 as permissions
#
# Edit your autofs master file to include something like
# /mnt/crypt /etc/auto.luks --timeout=600
#
# Then you can access your LUKS encrypted disk with
@bklockwood
bklockwood / offlinewucheck.ps1
Last active March 3, 2022 04:05
Powershell offline WU check
<#
This script performs the 'search' phase of a Windows Update, using the standard WUA API.
It does not download or install updates.
Sole purpose of this script is to find out how long it takes to download the required cabfile,
then process it against a live system and return the list of updates available for that system.
#>
function DownloadFile {
param (
[Parameter(Mandatory=$true,Position=0)] $url,
[Parameter(Mandatory=$true,Position=1)] $file
@follower46
follower46 / ObjectStorageUploader.py
Last active November 20, 2017 15:30
Object Storage Uploader Script
# ================================================================================
# ObjectStorageUploader.py
# © Copyright IBM Corporation 2014.
# LICENSE: MIT (http://opensource.org/licenses/MIT)
# ================================================================================
import argparse
import os
import math
import http.client
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 3, 2025 06:19
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mdnmdn
mdnmdn / ConvertTo-JSON.ps1
Last active December 12, 2024 00:59
ConvertTo-JSON for Powershell 2.0
function Escape-JSONString($str){
if ($str -eq $null) {return ""}
$str = $str.ToString().Replace('"','\"').Replace('\','\\').Replace("`n",'\n').Replace("`r",'\r').Replace("`t",'\t')
return $str;
}
function ConvertTo-JSON($maxDepth = 4,$forceArray = $false) {
begin {
$data = @()
}