This file contains hidden or 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
^(?:(?!不匹配字符).)*匹配字符(?:(?!不匹配字符).)*$ |
This file contains hidden or 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
2000 times - Insert | |
gorm: 9.60s 4800617 ns/op 5407 B/op 119 allocs/op | |
xorm: 12.63s 6315205 ns/op 2365 B/op 56 allocs/op | |
2000 times - BulkInsert 100 row | |
xorm: 23.89s 11945333 ns/op 253812 B/op 4250 allocs/op | |
gorm: Don't support bulk insert - https://github.com/jinzhu/gorm/issues/255 | |
2000 times - Update | |
xorm: 0.39s 195846 ns/op 2529 B/op 87 allocs/op |
This file contains hidden or 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
#define _GNU_SOURCE | |
#include <pwd.h> | |
#include <stdio.h> | |
#define BUFLEN 4096 | |
int | |
main(void) | |
{ | |
struct passwd pw, *pwp; | |
char buf[BUFLEN]; |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Outputs some information on CUDA-enabled devices on your computer, | |
including current memory usage. | |
It's a port of https://gist.github.com/f0k/0d6431e3faa60bffc788f8b4daa029b1 | |
from C to Python with ctypes, so it can run without compiling anything. Note | |
that this is a direct translation with no attempt to make the code Pythonic. |
This file contains hidden or 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 ( | |
"encoding/json" | |
"fmt" | |
"github.com/davecgh/go-spew/spew" | |
"strings" | |
) | |
type Nodes struct { |
This file contains hidden or 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 | |
mkdir -p ~/.trash/ | |
for target in $*;do | |
# rm参数无视 | |
if [[ "$target" =~ "^-" ]];then | |
continue; | |
fi | |
This file contains hidden or 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
mname="MOD_NAME$modnum" | |
mod_name="${!mname}" |
This file contains hidden or 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
#!/usr/bin/perl | |
####################################################### | |
# sendEmail | |
# Written by: Brandon Zehm <caspian@dotconf.net> | |
# | |
# License: | |
# | |
# This code is *NOT* to be used for sending SPAM email! | |
# If you are using this software to send spam email | |
# STOP RIGHT NOW, your license to use this software is |
This file contains hidden or 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
# /etc/profile | |
#Set our umask | |
umask 022 | |
# Set our default path | |
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin" | |
export PATH | |
# Load profiles from /etc/profile.d |
This file contains hidden or 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/sh | |
echo "Collecting data..." | |
echo "" | |
cat /proc/net/arp | grep : | grep ^192 | grep -v 00:00:00:00:00:00| awk '{print $1}'> mac-arp | |
iptables -N UPLOAD | |
iptables -N DOWNLOAD | |
while read line;do iptables -I FORWARD 1 -s $line -j UPLOAD;done < mac-arp | |
while read line;do iptables -I FORWARD 1 -d $line -j DOWNLOAD;done < mac-arp | |
sleep 1 |
NewerOlder