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 | |
ebtables -t broute -A BROUTING -p ! ipv6 -j DROP | |
brctl addbr ipv6br | |
ifconfig ipv6br up | |
brctl addif ipv6br eth0 | |
brctl addif ipv6br wlan0 |
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
interface=wlan0 | |
driver=nl80211 | |
hw_mode=a | |
ieee80211n=1 | |
ieee80211ac=1 | |
ieee80211d=1 | |
ieee80211h=1 | |
require_ht=1 | |
require_vht=1 |
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
<?php | |
$curl_cmd = trim(fgets(STDIN)); | |
$filename = md5($curl_cmd) . '.html'; | |
while (1) { | |
$ret = shell_exec($curl_cmd.' -w %{http_code} -o '. $filename .' -i'); | |
if ($ret != '503') break; | |
} | |
echo 'Saved to ' . $filename . "\n"; | |
?> |
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
/* | |
'A'-'Z'表示命题 | |
!表示非 | |
&表示合取 | |
|表示析取 | |
A@B表示如果A,那么B | |
A#B表示双条件 | |
()表示优先级 | |
*/ | |
#include <bits/stdc++.h> |
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 | |
import os.path | |
import win32com | |
import win32com.client | |
import time | |
def ppt2pptx(file): | |
powerpoint = win32com.client.Dispatch('PowerPoint.Application') | |
win32com.client.gencache.EnsureDispatch('PowerPoint.Application') | |
powerpoint.Visible = 1 | |
ppt = powerpoint.Presentations.Open(file) |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] | |
"RealTimeIsUniversal"=dword:00000001 |
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
module some_server( | |
input clk, | |
input rst, | |
input ethernet_frame_bit_in,//high bit first | |
output correct | |
); | |
reg [9:0] current_stat; | |
assign correct = (current_stat == 10'd896); |
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
module axi_perf( | |
input clock, | |
input reset, | |
input mem_axi4_0_awready, | |
output mem_axi4_0_awvalid, | |
output [3:0] mem_axi4_0_awid, | |
output [30:0] mem_axi4_0_awaddr, | |
output [7:0] mem_axi4_0_awlen, | |
output [2:0] mem_axi4_0_awsize, | |
output [1:0] mem_axi4_0_awburst, |
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
/* | |
Hello, I'm using d1-wip kernel from https://github.com/smaeul/linux/commits/riscv/d1-wip. | |
My rootfs is archriscv from https://mirrors.wsyu.edu.cn/archriscv/images/archriscv-20210601.tar.zst. | |
I found some programs running on this kernel will get SEGV, such as curl. | |
I delve into this problem and found the root cause is about pthread. It just trap at "amoswap.w.aq a5,a5,(s1)". And the value of register s1 is an address on the stack. | |
Here is a simple program with pthread. using gcc -lpthread to compile and run on D1-board with work in progress kernel is fine. |
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 <sys/mman.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
int main() { | |
int fd = shm_open("test-shm", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); | |
if (fd == -1) { | |
printf("Unable to open shm\n"); |
OlderNewer