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
// ==UserScript== | |
// @name Yad2 Ad update | |
// @namespace yad2 | |
// @description Simulates click on "kaftor3" | |
// @include http://my.yad2.co.il/MyYad2/MyOrder/Yad2.php | |
// ==/UserScript== | |
// Use chromium-browser --enable-easy-off-store-extension-install to install offline | |
// in Chrome | |
/* |
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
/** | |
* Based on https://www.fsl.cs.sunysb.edu/~vass/linux-aio.txt | |
* Compile gcc -Wall test_aio.c -o test_aio | |
* Run rm -rf /tmp/testfile ;./iotest | |
*/ | |
#define _GNU_SOURCE /* syscall() is not POSIX */ | |
#include <stdio.h> /* for perror() */ | |
#include <unistd.h> /* for syscall() */ |
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
static char* get_exe_name(int pid, char *buffer, int buffer_size) | |
{ | |
char *result = NULL; | |
struct mm_struct* mm = current->mm; | |
if (mm) | |
{ | |
int lock_result = down_read_trylock(&mm->mmap_sem); | |
if ((lock_result) && (mm->exe_file)) | |
{ |
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 cc1 %( "/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/cc1" %) | |
global insns | |
probe perf.hw.instructions.process(@cc1).counter("foo") {} | |
probe process(@cc1).function("*").return { | |
insns[execname(),tid()] = @perf("foo") // implicit max() | |
} |
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
static void get_inode(u64 fd, struct file **p_file, struct inode **p_inode) | |
{ | |
struct file *file = NULL; | |
struct inode *f_inode = NULL; | |
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3,7,0)) | |
file = fget_raw(fd); // do not forget to fput(file) | |
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,255)) | |
{ | |
struct files_struct *files = current->files; | |
if (files) // This is always the case, but I am not taking chances |
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
GIT_COMMIT_FILE=git_commit_filename.h | |
$(GIT_COMMIT_FILE): phony | |
$(eval GIT_COMMIT_SHA=$(shell git describe --abbrev=6 --always 2>/dev/null || echo 'Error')) | |
@echo SHA=$(GIT_COMMIT_SHA) | |
echo -n "static const char *GIT_COMMIT_SHA = \"$(GIT_COMMIT_SHA)\";" > $(GIT_COMMIT_FILE) |
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
/** | |
* Lockfree is a set of lockfree containers for Linux and Linux kernel | |
* Copyright (C) <2017> Arkady Miasnikov | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
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 | |
function echo_loop() | |
{ | |
file=echo_file_`date +%s%N` | |
echo $file | |
echo > $file | |
counter=1 | |
end=$((SECONDS+10)) | |
while [ $SECONDS -lt $end ]; do |
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
stap -D MAXSKIPPED=0 -D MAXTRYLOCK=1000000 -D TRYLOCKDELAY=1 -g -e 'global ar%; function w_ar() {ar[tid()]=tid();} %{long long counter;u8 shm[256];static void* w_shm(void);static void* w_shm() {memset(shm, 0, sizeof(shm));return shm;} %} probe syscall.close{w_ar();%{ {counter++;w_shm();} %}} probe syscall.close.return {w_ar();%{ {counter++;w_shm();} %}} probe syscall.open{w_ar();%{ {counter++;w_shm();} %}} probe syscall.open.return{w_ar();%{ {counter++;w_shm();} %}} probe syscall.dup2.return{w_ar();%{ {counter++;w_shm();} %}} probe syscall.dup2.return{w_ar();%{ {counter++;w_shm();} %}} probe syscall.read.return{w_ar();%{ {counter++;w_shm();} %}} probe syscall.read{w_ar();%{ {counter++;w_shm();} %}} probe end { %{ {printk("\n%lli\n", counter);} %}}' | |
stap -D MAXSKIPPED=0 -D MAXTRYLOCK=1000000 -D TRYLOCKDELAY=1 -g -e '%{long long counter;u8 shm[256];static void* w_shm(void);static void* w_shm() {memset(shm, 0, sizeof(shm));return shm;} %} probe syscall.close{%{ {counter++;w_shm();} %}} probe syscall.close |
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
probe kprocess.exec | |
{ | |
%{HIT_MAP_INC(HIT_MAP_KPROCESS_EXEC)%} | |
tid = tid() | |
if (stringat(filename,0) == 0x22) // filename starts with a quotation mark | |
{ | |
MAP_SYSCALL_EXEC_NAME[tid] = filename | |
MAP_SYSCALL_EXEC_ARGV[tid] = args | |
} | |
else // failed to recog the filename, trigger do_execve |
OlderNewer