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
#define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) | |
#define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) | |
#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) | |
#define ACCESS_TO_STAT(mask, user_mask) (((((mask)&R_OK)?S_IRUGO:0)|(((mask)&W_OK)?S_IWUGO:0)|(((mask)&X_OK)?S_IXUGO:0))&(user_mask)) | |
#define STAT_TO_ACCESS(mode, user_mask) ((((mode)&(user_mask)&S_IRUGO)?R_OK:0)|(((mode)&(user_mask)&S_IWUGO)?W_OK:0)|(((mode)&(user_mask)&S_IXUGO)?X_OK:0)) | |
// Usage: ACCESS_TO_STAT(R_OK | W_OK | X_OK, S_IRWXU) => 0700 | |
// ACCESS_TO_STAT(R_OK | W_OK, ACCESSPERMS) => 0666 | |
// ACCESS_TO_STAT(X_OK, S_IRWXU|S_IRWXO) => 0101 |
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 <unistd.h> | |
#include <sys/stat.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) | |
#define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) | |
#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) | |
#define ACCESS_TO_STAT(mask, user_mask) (((((mask)&R_OK)?S_IRUGO:0)|(((mask)&W_OK)?S_IWUGO:0)|(((mask)&X_OK)?S_IXUGO:0))&(user_mask)) | |
#define STAT_TO_ACCESS(mode, user_mask) ((((mode)&(user_mask)&S_IRUGO)?R_OK:0)|(((mode)&(user_mask)&S_IWUGO)?W_OK:0)|(((mode)&(user_mask)&S_IXUGO)?X_OK: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
#ifndef TROLOLOL_H | |
#define TROLOLOL_H | |
#ifdef TRUE | |
#undef TRUE | |
#endif | |
#ifdef FALSE | |
#undef FALSE | |
#endif |
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
echo -n This file system is case- > tmp; echo -n in >> TMP; echo sensitive >> tmp; cat tmp; rm tmp; rm TMP 2> /dev/null |
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
// | |
// fs_capabilities.m | |
// | |
// Created by Charles Francoise on 13/05/14. | |
// Copyright (c) 2014 Charles Francoise. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <errno.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
#!/usr/bin/python | |
# usage: sudo dtruss -a command 2>&1 > /dev/null | ./dtruss2csv.py > dtruss.log.csv | |
import re | |
import sys | |
if (len(sys.argv) > 1): | |
s = file(sys.argv[1], 'r').read() | |
else: | |
s = sys.stdin.read() |
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 | |
# Converts all flac files in the directory to high-quality mp3 | |
for flacfile in *.flac | |
do | |
flac --decode "$flacfile" | |
wavfile="${flacfile:0:(${#flacfile}-4)}wav" | |
lame -b320 -q0 -ms "$wavfile" | |
rm "$wavfile" | |
done |
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
/* | |
FUSE: Filesystem in Userspace | |
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> | |
This program can be distributed under the terms of the GNU GPL. | |
See the file COPYING. | |
*/ | |
/* |
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 <sys/types.h> | |
#include <sys/sysctl.h> | |
int main(int argc, char** argv) { | |
int mib[3], argmax; | |
size_t syssize; | |
char *procargs, *cp, *thiscmd; |
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 <unistd.h> | |
#include <sys/ioctl.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <net/if.h> | |
#include <netdb.h> | |
OlderNewer