Skip to content

Instantly share code, notes, and snippets.

View aleshkashell's full-sized avatar

Aleksey Sheludchenkov aleshkashell

View GitHub Profile
@timnew
timnew / Rename.ps1
Last active June 10, 2024 13:08
Script to Rename Computer without Reboot
$ComputerName = "New Name"
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname"
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname"
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\Computername" -name "Computername" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername" -name "Computername" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" -value $ComputerName
Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -name "AltDefaultDomainName" -value $ComputerName
@jahands
jahands / Get-DirHash.ps1
Last active December 22, 2023 16:26
Get hash of entire directory in powershell.
Function Get-DirHash {
[Cmdletbinding()]
Param(
[Parameter(Mandatory=$true)]
[ValidateScript({
if(Test-Path -Path $_ -ErrorAction SilentlyContinue)
{
return $true
}
else
@jaysoncena
jaysoncena / get-started-by-user.groovy
Created April 18, 2016 09:25
Jenkins - Get the user who triggered the current or the parent job
def triggeredBy = "---"
def iterateCause(b) {
upstreamcause = b.getCause(hudson.model.Cause.UpstreamCause.class)
if (upstreamcause != null) {
job = Jenkins.getInstance().getItemByFullName(upstreamcause.getUpstreamProject(), hudson.model.Job.class)
if (job != null) {
upstream = job.getBuildByNumber(upstreamcause.getUpstreamBuild())
if (upstream != null) {
iterateBuild(upstream)
@vinzenz
vinzenz / dial-mysql-via-ssh.go
Created November 7, 2016 10:27
Using MySQL / MariaDB via SSH in Golang
package main
import (
"database/sql"
"fmt"
"net"
"os"
"github.com/go-sql-driver/mysql"
"golang.org/x/crypto/ssh"
@superseb
superseb / rke2-commands.md
Last active July 3, 2024 02:07
RKE2 commands

RKE2 commands

  • Updated on May 29 to accommodate etcd container not having /bin/sh available anymore.

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@lukeplausin
lukeplausin / transfer_ssm_file.sh
Last active June 25, 2024 01:10
Transfer a file to EC2 SSM instance without using S3 (SSM only)
# This script will explain how to transfer a file to EC2 using SSM ONLY!
# You will need to have permission to run SSM commands on the target machine and have sudo access as well
# Infos
INSTANCE_ID=i-1234567890
FILE_NAME=the_file.tar.gz
# Step 1: Run command on machine to install netcat and dump from port to filename
# < Start session
@danielchc
danielchc / docker-emby-bypass.md
Last active July 4, 2024 13:07
Emby Premiere: ByPass Docker container

Emby Premiere ByPass Docker container

❗ All the information provided on this tutorial are for educational purposes only. I'm not responsible for any misuse of this information. If you like the app buy it

Table of Contents