Skip to content

Instantly share code, notes, and snippets.

@lovese
lovese / fix-google-translate-cn.sh
Created October 8, 2022 12:21 — forked from bookfere/fix-google-translate-cn.sh
Fix Google Translate CN for macOS
#!/bin/bash
# Copyright (c)2022 https://bookfere.com
# This is a batch script for fixing Google Translate and making it available
# in the Chinese mainland. If you experience any problem, visit the page below:
# https://bookfere.com/post/1020.html
SOURCE_DOMAIN=google.cn
TARGET_DOMAIN=translate.googleapis.com
HOSTS_FILE=/etc/hosts
@lovese
lovese / fix-google-translate-cn.bat
Created October 8, 2022 12:20 — forked from bookfere/fix-google-translate-cn.bat
Fix Google Translate CN for Windows
:: Copyright (c)2022 https://bookfere.com
:: This is a batch script for fixing Google Translate and making it available
:: in the Chinese mainland. If you experience any problem, visit the page below:
:: https://bookfere.com/post/1020.html
@echo off
setlocal enabledelayedexpansion
chcp 437 >NULL
set "source_domain=google.cn"
@lovese
lovese / 企业标准化运维权限管理实施方案.md
Last active September 13, 2018 08:49
企业标准化运维权限管理实施方案.md

企业标准化运维权限管理实施方案

目录:

  • 1.需求分析

  • 2.建设规范

  • 3.技术分解

find . -type d -name ".svn"|xargs rm -rf 删除当前目录及子目录下的svn文件
svn st | awk '{if ($1 == "?") {print $2} }' | xargs svn add svn添加所有新增文件
find . -type d -exec chmod 700 {} \; 修改所有目录访问权限
find . -type f -exec chmod 600 {} \; 修改所有文件访问权限
find . -name "*.php" -exec php {} \; 执行所有的php文件
grep -rli "helper('itags')" * | xargs -i@ sed -i "s/helper('itags')/helper('core')/g" @ 将所有文件中包含的某字符串替换成另一字符串
grep -rli --include=*.php.dec '?><?php' . | xargs -i@ sed -i "s/?><?php/<?php/g" @
pcregrep -MHrin --color "addOrder.*\n.*1442470135100001" . 多行搜索(跨行)
set quote="'" ; phpgrep -i '\(select\|update\|delete\|insert\).*;\("\|${quote}\)' . 搜索以分号;结尾的SQL语句
@lovese
lovese / README.md
Created August 30, 2017 15:58 — forked from balupton/README.md
Installing ChromiumOS

Install ChromiumOS

  1. Get Chromium OS from one of the following places
    1. Download the vanilla build (old but stable): http://chromeos.hexxeh.net/
      1. NOTE: Password is facepunch
    2. Download the nightly build (sync doesn't work): http://download-chromiumos.appspot.com/
      1. NOTE: If you want developer mode, you must change _base_ in the download URL to _test_ as the base image does not have developer tools enabled
      2. NOTE: Password is unknown, instructions for working around this are provided later
      3. NOTE: I could not get syncing working with this build, perhaps due to no API KEYS being provided???
  2. NOTE: I could not move past the welcome screen on the 64bit build due to no network being found (32bit worked)
@lovese
lovese / chromebook-nix.sh
Created August 25, 2017 11:04 — forked from puffnfresh/chromebook-nix.sh
Installation script for Nix on ChromeOS
#!/bin/sh
sudo mount -o remount,exec /tmp
if [ -x /usr/local/nixstrap/proot-x86_64 ] && [ -h ~/.nix-profile ]; then
echo "Launching shell with nix-* tools!"
exec /usr/local/nixstrap/proot-x86_64 -b /usr/local/nixstrap/nix-1.8-x86_64-linux:/nix bash --init-file ~/.nix-profile/etc/profile.d/nix.sh
fi
set -e
@lovese
lovese / pr.md
Created August 23, 2017 08:31 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@lovese
lovese / initial_centos6.sh
Created August 22, 2017 01:47 — forked from vmlive/initial_centos6.sh
Centos 6初始化脚本
#!/bin/bash
#
# # sample usage
# curl -o /tmp/initial_centos6.sh https://gist.github.com/vmlive/9994394/raw
# nohup /bin/bash /tmp/initial_centos6.sh > /tmp/initial_centos6.sh.log && rm -f /tmp/initial_centos6.sh &
#
#this script is only for CentOS 6
#check the OS
@lovese
lovese / README.md
Created August 16, 2017 01:54 — forked from kmassada/README.md
Vagrant and KVM(QEMU) on Centos7

Libvirt

yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf