This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def write_list_to_file(filename, my_list): | |
with open(filename, 'w') as file: | |
file.writelines(str(item) + '\n' for item in my_list) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
directory = "/home/XX/Documents/blog-new/content/posts" | |
os.chdir(directory) | |
def do(filename): | |
r = open(filename, 'r') | |
lines = r.readlines() | |
r.close() | |
w = open(filename, 'w') | |
i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"strings" | |
"fmt" | |
"github.com/pingcap/parser/ast" | |
"github.com/pingcap/parser" | |
_ "github.com/pingcap/tidb/types/parser_driver" // https://github.com/pingcap/parser/issues/43 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## exit when any error | |
## set -e | |
TIDB_CONTAINER_NAME=tidb-docker-compose_tidb_1 | |
GOOS=linux GOARCH=amd64 make server || { printf "\e[31m!!! build failed !!!\e[0m\n"; exit 1; } | |
printf "\e[38;5;82mTiDB version before:\n\e[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
nsqlookupd: | |
image: nsqio/nsq:v0.3.8 | |
command: /nsqlookupd | |
restart: always | |
ports: | |
- "4160:4160" | |
- "4161:4161" | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://code.google.com/p/ntzc/source/browse/trunk/zc/ixgbe/set_irq_affinity.sh | |
# | |
# | |
# setting up irq affinity according to /proc/interrupts | |
# 2008-11-25 Robert Olsson | |
# 2009-02-19 updated by Jesse Brandeburg | |
# | |
# > Dave Miller: | |
# (To get consistent naming in /proc/interrups) | |
# I would suggest that people use something like: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# generate cscope index files in current directory | |
# the generated cscope index files also include go standard packages | |
if [ $GOROOT = "" ] | |
then | |
echo "GOROOT is not set" | |
exit 1 | |
fi |