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
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"time" | |
) |
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 re | |
if __name__ == "__main__": | |
top = '/tmp/shared' | |
ren = '/tmp/shared2' | |
for dp, dn, fns in os.walk(top, topdown=False): | |
for fn in fns: | |
porig = os.path.join(dp, fn) | |
if "/." in porig: | |
continue |
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/env python3 | |
# This script simulates user activity, preventing automated suspension, if any file is begin accessed through samba server. | |
# works on Plasma 5, and, AFAIK, not Gnome | |
# based on https://bbs.archlinux.org/viewtopic.php?pid=1797228#p1797228 | |
# | |
# Uses smbstatus (which requires root permissions) to find if samba is locking some file or directory. | |
# Do not run with sudo (wouldn't be able to connect to the SessionBus), instead | |
# add smbstatus to the sudoers file, to allow running it without password, for example: | |
# username ALL = (ALL) NOPASSWD: /usr/bin/smbstatus |
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 <unistd.h> | |
#include <sys/wait.h> | |
#include <errno.h> | |
#include <limits.h> | |
#include <string.h> | |
extern int errno; |