Skip to content

Instantly share code, notes, and snippets.

View kodybrown's full-sized avatar
💭
I may be slow to respond.

Kody Brown kodybrown

💭
I may be slow to respond.
View GitHub Profile
@rossarioking
rossarioking / Transcript.ps1
Created March 7, 2020 18:08
Creating PowerShell Transcripts #PowerShell
#Create Folder where transcript files will be saved,
md C:\Transcripts
#This captures all of the console data and outputs it to a transcript file.
Start-Transcript -path .\Transcripts\Mytranscript.txt -append
# All Data inbetween these commands will be written to the trascript file.
#Stops recording Transcript input.
@rollwagen
rollwagen / powershell_file_io_upload.ps1
Last active May 11, 2023 23:29
powershell snippets #powershell #upload
$sourceFilePath = "/etc/apt/archive"
$siteAddress = "https://file.io/?expires=1w"
$webClient = New-Object System.Net.WebClient
$response
try {
$response = $webClient.UploadFile($siteAddress,$sourceFilePath)
} catch {
Write-Host $_
}
[System.Text.Encoding]::ASCII.GetString($response)
@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active July 22, 2024 22:17
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
@matdcooper
matdcooper / gitflow-cheatsheet.md
Created January 10, 2019 14:50
Git-Flow Cheat-Sheet

Creating git repo

  • Create directory
  • Go into new directory
  • Create bare repo
    • git init --bare
  • Clone repo somewhere
    • git clone <repo>
  • Go into repo folder
  • Create .gitignore file
@secretGeek
secretGeek / Program.cs
Created August 30, 2017 12:47
simulate Alt-Enter in parent console from windows app
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace PaulBettsWIN32
{
static class Program
{
[STAThread]
static void Main(string[] args)
@gschema
gschema / Git - how to temporarily ignore and unignore file changes.md
Last active May 15, 2023 03:34
How to temporarily ignore and unignore file; check which files are ignored

How to temporarily ignore/unignore file changes in Git?

ignore:

git update-index --assume-unchanged <file>

unignore:

git update-index --no-assume-unchanged 
@deevus
deevus / build.ps1
Created April 21, 2015 07:22
Cross Compile GNU Hello using Docker
$pkg = "hello-2.10"
$file = "$pkg.tar.gz"
# get dockerfile
invoke-webrequest "https://raw.githubusercontent.com/deevus/docker-mxe/develop/Dockerfile" -outfile "Dockerfile"
# get package
if(!(test-path $file)) {
invoke-webrequest "http://gnu.mirror.uber.com.au/hello/$file" -outfile $file
}
@dhanifudin
dhanifudin / autosave.vim
Last active December 20, 2015 16:00
Automatically save and remove trailing whitespace for vim
" Declare ignore filetype here
let g:ignore_autosave = 'tex'
function AutoSave()
if &modifiable == 1 && &readonly == 0
\ && expand('%') != ''
\ && &buftype != 'nofile'
%s/\s\+$//e
if &filetype != g:ignore_autosave
update
@mitchwongho
mitchwongho / Docker
Last active June 26, 2024 07:28
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@whatisinternet
whatisinternet / chklty Updater.bat
Created January 17, 2014 17:56
http://chocolatey.org/ install and update scripts (batch)
@echo off
cls
echo browsers
powershell cup Firefox
powershell cup GoogleChrome
cls
echo plugins
powershell cup Silverlight