Skip to content

Instantly share code, notes, and snippets.

View sunnoy's full-sized avatar
🎯
Focusing

sunnoy

🎯
Focusing
View GitHub Profile
sudo yum install -y pam-devel
sudo yum install -y rpm-build
sudo yum install -y zlib-devel
mkdir -p ~/rpmbuild/SOURCES
cd ~/rpmbuild/SOURCES
wget -c http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz
wget -c http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz.asc
# verify the file
# update the pam ssd from the one included on the system
@sunnoy
sunnoy / Deploy-VM.ps1
Created March 30, 2022 09:33 — forked from ronaldvanvugt/Deploy-VM.ps1
Deploy and customize a VM in vCenter with PowerCLI
# Deploy Windows Server 2008 or higher in vCenter
#### USER DEFINED VARIABLES ############################################################################################
$Domain = "" #AD Domain to join
$vCenterInstance = "" #vCenter to deploy VM
$Cluster = "" #vCenter cluster to deploy VM
$VMTemplate = "" #vCenter template to deploy VM
$CustomSpec = "" #vCenter customization to use for VM
$Location = "" #Folderlocation in vCenter for VM
$DataStore = "" #Datastore in vCenter to use for VM
@sunnoy
sunnoy / update_iterm2_profiles.py
Created May 14, 2021 02:20 — forked from rsperl/update_iterm2_profiles.py
update iterm2 dynamic profiles from ssh config
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
class SshConfigParser(object):
entries = []
@sunnoy
sunnoy / shell_output.go
Created May 6, 2021 14:24 — forked from hivefans/shell_output.go
get the realtime output for a shell command in golang|-|{"files":{"shell_output.go":{"env":"plain"}},"tag":"bigdata"}
package main
import (
"bufio"
"fmt"
"io"
"os"
"os/exec"
"strings"
)
@sunnoy
sunnoy / traffic-control.sh
Created April 16, 2021 14:07 — forked from ole1986/traffic-control.sh
Traffic control script for incoming and outgoing packages using TC (on a specific ip address)
#!/bin/bash
VERSION="1.0.2"
# Interface connect to out lan
INTERFACE="eth0"
# Interface virtual for incomming traffic
VIRTUAL="ifb0"
# set the direction (1 = outgoing only, 2 = incoming only 3 = both)
DIRECTION=3
# Speed
@sunnoy
sunnoy / README.md
Created November 19, 2020 07:50 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@sunnoy
sunnoy / README.md
Created June 18, 2020 04:25 — forked from smoser/README.md
qemu to linux mapping of smbios / dmi information

Mappings for DMI/SMBIOS to Linux and dmidecode

Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.

Mappings

Example qemu cmdline:

qemu-system-x86_64 -smbios type=<type>,field=value[,...]

qemu-system-x86_64 -smbios type=0,vendor=superco,version=1.2.3
@sunnoy
sunnoy / docker-compose.yml
Created October 28, 2019 12:04 — forked from thomasdarimont/docker-compose.yml
Docker OpenLDAP + phpldapadmin example
version: '2'
services:
openldap:
image: osixia/openldap:1.2.3
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.org"
LDAP_BASE_DN: ""
@sunnoy
sunnoy / clean-docker-for-mac.sh
Created September 23, 2019 09:43 — forked from MrTrustor/clean-docker-for-mac.sh
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or