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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#include <linux/init.h> | |
#include <linux/module.h> | |
#include <linux/kernel.h> | |
#include <linux/syscalls.h> | |
#include <linux/security.h> | |
#include <linux/namei.h> | |
static int my_mkdir(const char *name, umode_t mode) | |
{ |
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
$MPIODisks = Get-WmiObject -Namespace "root\wmi" -Class mpio_disk_info | | |
Select-Object "DriveInfo" | |
foreach ($Disk in $MPIODisks) { | |
$mpiodrives = $disk.DriveInfo | |
foreach ($Drive in $mpiodrives) { | |
Write-Host "Drive : " $Drive.Name | |
Write-Host "Path : " $Drive.NumberPaths | |
Write-Host "Serial Num: " $Drive.SerialNumber |
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
$MPIODisks = Get-WmiObject -Namespace "root\wmi" -Class mpio_disk_info | | |
Select-Object "DriveInfo" | |
foreach ($Disk in $MPIODisks) { | |
$mpiodrives = $disk.DriveInfo | |
foreach ($Drive in $mpiodrives) { | |
Write-Host "Drive : " $Drive.Name | |
Write-Host "Path : " $Drive.NumberPaths | |
Write-Host "Serial Num: " $Drive.SerialNumber |
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
;;; init.el --- Spacemacs Initialization File | |
;; | |
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors | |
;; | |
;; Author: Sylvain Benner [email protected] | |
;; URL: https://github.com/syl20bnr/spacemacs | |
;; | |
;; This file is not part of GNU Emacs. | |
;; | |
;;; License: GPLv3 |
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
CHAR hex_asc[] = "0123456789abcdef"; | |
#define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | |
#define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | |
#define TracePrintEx(Fmt, ...) \ | |
do\ | |
{\ | |
DbgPrintEx(DPFLTR_FASTFAT_ID, DPFLTR_ERROR_LEVEL, Fmt, __VA_ARGS__); \ | |
}while (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
import requests | |
import logging | |
url='http://readfree.me/accounts/checkin' | |
cookie_str='' # 需要登录到readfree上获取当时的cookie值,然后直接使用该cookie值进行登录签到 | |
logging.basicConfig(level=logging.INFO, | |
filename='/var/log/readfree_auto_sig.log', | |
filemode='a', | |
format='%(asctime)s - [line:%(lineno)d] - %(levelname)s: %(message)s') |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <cjson/cJSON.h> | |
#define ERR_INVALID_URL (-10) | |
#define ERR (-1) | |
int filter_single_sensitive_word(const cJSON *item, char *name) | |
{ |
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/sh | |
#line='id:2377893499379884 ip:127.0.0.1 port:443 ak:sdjh sk:jsdhfhjdsh bucket:men object:zzzz.vhd size:10240 encryp:1' | |
line=`cat image.cfg|grep 2377893499379884` | |
function map_get() | |
{ | |
dict=$1 | |
key=$2 | |
default_value=$3 |
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 | |
function cpuinfo() { | |
cpu_model=`cat /proc/cpuinfo|grep "model name"|head -1|awk -F: '{print $2}'` | |
cpu_num=`cat /proc/cpuinfo|grep "core id"|grep "0"|uniq -c|awk '{print $1}'` | |
cpu_cores=`cat /proc/cpuinfo|grep "processor"|wc -l` | |
single_cores=`expr ${cpu_cores} / ${cpu_num}` | |
printf "CPU: ${cpu_model} (${cpu_num}*${single_cores}Cores)\n" |