Skip to content

Instantly share code, notes, and snippets.

View cainejunkazama's full-sized avatar

Sascha Trebbin cainejunkazama

  • Berlin, Germany
View GitHub Profile
@cainejunkazama
cainejunkazama / angular2-mail-sig-app-proof-of-concept.markdown
Created April 3, 2017 14:50
Angular2 Mail-Sig-App Proof Of Concept
@cainejunkazama
cainejunkazama / .bashrc
Created October 11, 2015 20:16
Bash shared history snippet taken from https://news.ycombinator.com/item?id=3533895
# Append to ~/.bash_history instead of overwriting it -- this stops terminals
# from overwriting one another's histories.
shopt -s histappend
# Only load the last 1000 lines from your ~/.bash_history -- if you need an
# older entry, just grep that file.
HISTSIZE=1000
# Don't truncate ~/.bash_history -- keep all your history, ever.
unset HISTFILESIZE
# Add a timestamp to each history entry.
HISTTIMEFORMAT="%Y/%m/%d %H:%M:%S "
@cainejunkazama
cainejunkazama / xp-mode-backup.bat
Created June 10, 2014 15:05
windows-xp-mode-vm-backup
setlocal EnableDelayedExpansion
REM Script für Backup von einer "Windows XP Mode" VM unter Windows 7
vm-diff-sourcedir=""
vm-base-sourcedir=""
target-dir=""
IF %1 EQU "backup" GOTO backup
IF %1 EQU "restore" GOTO restore
:backup
function Get-NetworkStatistics
{
[OutputType('System.Management.Automation.PSObject')]
[CmdletBinding(DefaultParameterSetName='name')]
param(
[Parameter(Position=0,ValueFromPipeline=$true,ParameterSetName='port')]
[System.String]$Port='*',
[Parameter(Position=0,ValueFromPipeline=$true,ParameterSetName='name')]
# Store string for computer name
$Computer = read-host "Enter Computer Name:"
# Query computer using WMI and return selected values
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName $Computer | Select-Object -Property PSComputerName,IPAddress,DefaultIPGateway,DNSServerSearchOrder,DHCPEnabled,DHCPServer,DNSHostName,IPSubnet,MACAddress
@echo off
echo Stopping print spooler.
echo.
net stop spooler
echo deleting temp files.
echo.
del %windir%\system32\spool\printers\*.* /q
echo Starting print spooler.
echo.
net start spooler
$newName = "NewName"
$oldName = gc env:computername
$Computer = Get-WmiObject Win32_ComputerSystem -ComputerName $oldName
$r = $Computer.Rename($newName, "Pa55w0rd", "DOMAIN\adminuser")
echo "Exit code: " $ret.ReturnValue
exit $r.ReturnValue
mode con:cols=90 lines=25
@echo off
title=Remote Kill ^| © 2012 Ryan Jones v0.01
:start
set sessionid=
set host=
:enterhn
color 0F
cls
echo.
Function Start-CountDown
{ <#
.SYNOPSIS
Simple sleep function with a visual countdown.
.DESCRIPTION
Simple function that will sleep the script for the designated time, and give
a visual countdown to the user. You can specify the countdown message and
time in seconds. The current number of seconds left will be displayed at the
end of your message.