This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22
First install Rosetta if not already done, this is needed to run x86 code:
| #!/bin/bash | |
| # 检查系统版本 | |
| if [ -f /etc/redhat-release ]; then | |
| OS_VERSION=$(grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release) | |
| else | |
| echo "未找到 /etc/redhat-release 文件。请确保您运行的是 CentOS 系统。" | |
| exit 1 | |
| fi |
| #!/usr/bin/env bash | |
| echo=echo | |
| for cmd in echo /bin/echo; do | |
| $cmd >/dev/null 2>&1 || continue | |
| if ! $cmd -e "" | grep -qE '^-e'; then | |
| echo=$cmd | |
| break | |
| fi | |
| done |
This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22
First install Rosetta if not already done, this is needed to run x86 code:
| -- Author: Michael Bianco <http://mabblog.com/> | |
| -- Some help from: http://discussions.info.apple.com/message.jspa?messageID=10363317 | |
| on create_vpn_service(vpn_name) | |
| tell application "System Preferences" | |
| reveal pane "Network" | |
| activate | |
| tell application "System Events" | |
| tell process "System Preferences" |
| <?php | |
| // refer: http://hustnaive.github.io/php/2015/08/21/php-detect-encoding.html | |
| /** | |
| * 检测字符串编码(注意:存在误判的可能性,降低误判的几率的唯一方式是给出尽可能多的样本$line) | |
| * 检测原理:对给定的字符串的每一个字节进行判断,如果误差与gb18030在指定误差内,则判定为gb18030;与utf-8在指定误差范围内,则判定为utf-8;否则判定为utf-16 | |
| * @param string $line | |
| * @return string 中文字符集,返回gb18030(兼容gbk,gb2312,ascii);西文字符集,返回utf-8(兼容ascii);其他,返回utf-16(双字节unicode) | |
| * @author fangl |
| # .bashrc | |
| # User specific aliases and functions | |
| alias rm='rm -i' | |
| alias cp='cp -i' | |
| alias mv='mv -i' | |
| alias ll='ls -al' | |
| # Source global definitions |
| # bash | |
| https://stackoverflow.com/questions/33632668/bash-tab-completion-of-filenames-after-arguments | |
| complete -D -o default | |
| # zsh | |
| https://unix.stackexchange.com/questions/333530/zsh-path-file-name-completion-on-file-arguments/333543#333543?newreg=65c5031ab2d6429984db9f2c4a26ac3c |
Install tcpkill
yum -y install dsniff --enablerepo=epel
View connections
netstat -tnpa | grep ESTABLISHED.*sshd.
Block with ip tables
iptables -A INPUT -s IP-ADDRESS -j DROP
Kill connection
| // https://juejin.im/post/5b3629cbf265da59645b1ac5 | |
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| "net" |
| #!/bin/bash | |
| # ssh-multi | |
| # D.Kovalov | |
| # Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html | |
| # a script to ssh multiple servers over multiple tmux panes | |
| starttmux() { | |
| if [ -z "$HOSTS" ]; then |