Skip to content

Instantly share code, notes, and snippets.

_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide
@c4nc
c4nc / pssql.psm1
Created September 16, 2023 19:47
powershell sql
<#
.SYNOPSIS
Performs a SQL query and returns an array of PSObjects.
.NOTES
Author: Jourdan Templeton - [email protected]
.LINK
https://blog.jourdant.me/post/simple-sql-in-powershell
#>
function Invoke-SqlCommand() {
[cmdletbinding(DefaultParameterSetName="integrated")]Param (
@c4nc
c4nc / minikatz.ps1
Created September 16, 2023 15:58
minikatz
This file has been truncated, but you can view the full file.
function Invoke-Mimikatz
{
<#
.SYNOPSIS
This script leverages Mimikatz 2.2.0 and Invoke-ReflectivePEInjection to reflectively load Mimikatz completely in memory. This allows you to do things such as
dump credentials without ever writing the mimikatz binary to disk.
The script has a ComputerName parameter which allows it to be executed against multiple computers.
This script should be able to dump credentials from any version of Windows through Windows 8.1 that has PowerShell v2 or higher installed.
@c4nc
c4nc / miniview.ps1
Created September 16, 2023 15:43
miniview.ps1
function Get-DomainSID {
param(
[String]
$Domain
)
$FoundDomain = Get-NetDomain -Domain $Domain
if($FoundDomain) {
$PrimaryDC = $FoundDomain.PdcRoleOwner
Write-Host "Dio se soffro!"
@c4nc
c4nc / 0-downtime-deploy-Unicorn-Systemd.md
Last active September 28, 2023 08:14
0-downtime deploy Unicorn Systemd

##Working configuration to accomplish 0-downtime deploy with unicorn 5.x and systemd on centos 7

The scope is to accomplish a 0-downtime reload of a unicorn service managed by Systemd on a Centos 7 distro.

The examples and assumptions that i found on the bogomips's unicorn repo seems not working for centos 7.

Below a working configuration tested on Centos 7 and unicorn 5.1

Any advice/remark will be appreciated

Keybase proof

I hereby claim:

  • I am c4nc on github.
  • I am canc (https://keybase.io/canc) on keybase.
  • I have a public key ASAoLkfW10pmcbYwC7JP52RSoQfNJmIhdMMEU3qCcf0vCgo

To claim this, I am signing this object:

@c4nc
c4nc / unicorn init
Last active November 8, 2016 11:03
Unicorn conf 0 downtime centos 6
#!/bin/bash
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the unicorns at boot
# Description: Enable at boot time.
#