Skip to content

Instantly share code, notes, and snippets.

@rdymc
rdymc / Win10_To_Go_USB.cmd
Last active April 2, 2019 12:17
Windows 10 To Go USB
REM OS : Win10
REM Windows 10 To Go
diskpart
REM DISKPART Mode
DISKPART> list disk
DISKPART> select disk 1
DISKPART> clean
DISKPART> create partition primary
DISKPART> format fs=ntfs quick
DISKPART> assign
#!/bin/bash
firewall-cmd --remove-service=ssh --permanent
#firewall-cmd --add-service=http --add-source=1.1.1.1/32 --permanent
#firewall-cmd --add-service=ssh --add-source=1.1.1.1/32 --permanent
firewall-cmd --add-rich-rule="rule family="ipv4" source address="1.1.1.1" service name="ssh" accept" --permanent
firewall-cmd --add-rich-rule="rule family="ipv4" source address="1.1.1.1" service name="http" accept" --permanent
firewall-cmd --reload
firewall-cmd --list-all
iptables -S
@rdymc
rdymc / kb967342.cmd
Last active April 3, 2019 07:55
IIS 7.0 Hotfix KB967342
@echo off
:: See https://support.microsoft.com/zh-tw/help/967342
cd C:\Windows\System32\inetsrv
appcmd.exe set config -section:system.webServer/serverRuntime /alternateHostName:"<Server Name>" /commit:apphost
@rdymc
rdymc / start_min.cmd
Created April 3, 2019 08:15
Run a batch file or other files minimized
@echo off
:: Usage: start_min.cmd [*.bat or *.cmd]
cls
cd %~dp0
start /min cmd.exe /c %1 ^& exit
@rdymc
rdymc / disable_Low_TLS.reg
Last active April 12, 2019 11:11
Windows Server disable Low TLS
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client]
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server]
@rdymc
rdymc / disable_weak_ciphers.reg
Created April 3, 2019 08:22
Windows Server disable weak ciphers
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\DES 56/56]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\NULL]
"Enabled"=dword:00000000
@rdymc
rdymc / ubuntu_pppoe.sh
Last active April 18, 2019 09:24
Ubuntu PPPoE setting
#!/bin/bash
apt -y install pppoeconf
# Setup pppoe
sudo pppoeconf
# Config file : /etc/ppp/peers/dsl-provider
# Add IPv6 : echo "+ipv6" >> /etc/ppp/peers/dsl-provider
# Usage
@rdymc
rdymc / M-Lab_NDT_centos.sh
Last active April 19, 2019 09:25
Network Diagnostic Tool (NDT) SpeedTest (For CentOS)
#!/bin/bash
yum update
yum --assumeyes install epel-release
yum -y install wget
# Reference : http://software.internet2.edu/
wget --output-document=./perfSONAR-repo-0.8-1.noarch.rpm http://software.internet2.edu/rpms/el6/x86_64/RPMS.main/perfSONAR-repo-0.8-1.noarch.rpm
rpm --import http://software.internet2.edu/rpms/RPM-GPG-KEY-perfSONAR
rpm -ivh perfSONAR-repo-0.8-1.noarch.rpm
@rdymc
rdymc / centos_pppoe.sh
Last active April 19, 2019 10:05
CentOS PPPoE setting
#!/bin/bash
yum -y install rp-pppoe
# Disable Network Manager
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
# Enable IPv6 PPPoE
echo 'ipv6 ,' >> /etc/ppp/options
#!/bin/bash
#
# Copyright (c) 2015, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright