Skip to content

Instantly share code, notes, and snippets.

View sdovnic's full-sized avatar
🐱
Inspector Cat

Svenja Dovnic sdovnic

🐱
Inspector Cat
  • DNN digital-nerv.net
  • Allemagne
View GitHub Profile
@sdovnic
sdovnic / gist:96b2b77d9fa5185d3424
Created August 26, 2014 22:42
TechniSat DVB-PC TV Star PCI
:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
@sdovnic
sdovnic / self-elevating-script.ps1
Last active February 6, 2023 18:27 — forked from zblesk/self-elevating-script.ps1
A self-elevating powershell script.
if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
"Running as admin in $PSScriptRoot"
}
else
{
"NOT running as an admin!"
Start-Process powershell -WorkingDirectory $PSScriptRoot -Verb runAs -ArgumentList "-noprofile -noexit -file $PSCommandPath"
return "Script re-started with admin privileges in another shell. This one will now exit."
}
@sdovnic
sdovnic / Show-Firewall.ps1
Last active July 7, 2023 13:33
Show-Firewall
function Show-Firewall {
<#
.SYNOPSIS
Shows detailed Firewall Rules.
.DESCRIPTION
Shows you Details of Firewall Rules by selected Name. You can output the result into an GridView or Netsh Commands.
.PARAMETER DisplayName
The Name of the Rule, Wildcards are allowed.
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title>Cool web-app</title>
<!-- iPhone - iPod touch - 320x460 -->
<link href="splashscreen.png" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPhone - iPod (Retina) - 640x920 -->

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@sdovnic
sdovnic / tmux-cheatsheet.markdown
Created June 27, 2016 20:45 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sdovnic
sdovnic / encrypt-gpg.sh
Created April 6, 2017 17:38
Encryption Helper for SaltStack
#!/usr/bin/env bash
# Copyright 2015 - 2017 Tobias Benzin tbenzin@digital-nerv.net
# Rally Vincent rvincent@digital-nerv.net
function input_string {
echo "── Input ────────────────────────────────────────────────────────────────────┐"
echo "${*}"
echo "─────────────────────────────────────────────────────────────────────────────┘"
echo ""
echo "── Encrypted ────────────────────────────────────────────────────────────────┐"
@sdovnic
sdovnic / readme.md
Created April 6, 2017 17:42
SaltStack Deployment Guide
if ($Event.Services -match "wlidsvc") {
if ((Get-WmiObject -Class Win32_OperatingSystem).Caption -match "Windows 10") {
$Name = "Windows Live ID Service {0}" -f $Event.DestPort
if (-not (Get-NetFirewallRule -Name $Name -ErrorAction SilentlyContinue)) {
New-NetFirewallRule -Name $Name -DisplayName $Name -Enabled True `
-Profile Any -Direction Outbound -Action Allow `
-LocalAddress Any -RemoteAddress $Event.DestAddress `
-Protocol "TCP" -LocalPort Any -RemotePort $Event.DestPort `
-Program "%SystemRoot%\System32\svchost.exe"
} else {
# Hide ShowTaskViewButton / Default: 1 or not exist
if (-not ((Get-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -ErrorAction SilentlyContinue) -match 0)) {
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -Value 0 -Type DWord -Verbose
$RestartExplorer = $true
}
# Hide PeopleBand / Default: 1
if (-not ((Get-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -ErrorAction SilentlyContinue) -match 0)) {
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -Value 0 -Type DWord -Verbose
$RestartExplorer = $true