recentpopularlog in

kme : filesystem   139

« earlier  
File::Util - Easy, versatile, portable file handling -

Syntax: escape_filename( [string], [escape char] )

Returns it's argument in an escaped form that is suitable for use as a filename. Illegal characters (i.e.- any type of newline character, tab, vtab, and the following / | * " ? < : > \), are replaced with [escape char] or "_" if no [escape char] is specified. Returns an empty string if no arguments are provided. This is an autoloaded method.
perl  module  filesystem  filename  security  sanitization 
june 2019 by kme
pam_mount - ArchWiki |
This avoids double mount attempts and errors relating to dropped privileges.
pam  pam_mount  network  filesystem  automount  cifs  maybesolution 
april 2018 by kme
pam_mount module / Bugs / #44 v1.3 - unknown pam_mount option "try_first_pass" |
try_first_pass is obsolete. The replacement is called "enable_pam_password" as per doc/options.txt. 'pam_password' is enabled by default, so you do not need to specify it either.
linux  cifs  pam  mount  network  filesystem  errormessage  solution 
april 2018 by kme
Cipher | Microsoft Docs |
Displays or alters the encryption of folders and files on NTFS volumes. Used without parameters, cipher displays the encryption state of the current folder and any files it contains.

windows  secureerase  ntfs  filesystem  security  utility  commandline  reference  sysadmin 
april 2018 by kme
python - From stat().st_mtime to datetime? - Stack Overflow |
Try datetime.fromtimestamp(statResult.st_mtime)

<code class="language-python">import datetime

mod_timestamp = datetime.datetime.fromtimestamp(path.getmtime(<YOUR_PATH_HERE>))</code>
stat  unix  filesystem  timeanddate  solution 
march 2018 by kme
DORMANDO - / /usr /home split
I swear I first read this in a Slackware install guide, but I had the habit of making /, /usr, /home, as well as /tmp or /var split into different mounts. The theory was that the files in / changed least, /usr more often, with /home, /tmp, and /var touched most often.

So in the case of power loss, kernel panic, or cords-wrapped-around-chairs, the filesystems were split in highest odds of being able to boot again to rescue the system. / contained just enough to boot, /usr had more useful utilities, and /home had all your stuff. I personally benefitted from this split several times on servers and a home machine.
unix  filesystem  sysadmin  butwhy  explained 
march 2018 by kme
How do I remove "permission denied" printout statements from the find program? - Unix & Linux Stack Exchange |
Those messages are sent to stderr, and pretty much only those messages are generally seen on that output stream. You can close it or redirect it on the command-line.

$ find / -name netcdf 2>&-


$ find / -name netcdf 2>/dev/null
find  findutils  filesystem  shellscripting  stderr  redirection  reference  solution 
october 2017 by kme
How to extract a file extension in PHP? - Stack Overflow |
So this works
<code class="language-php">pathinfo('SNP_sequence.nonref.fa', PATHINFO_EXTENSION)</code>
php  filename  strings  textprocessing  filesystem  webdevel  solution 
october 2017 by kme
entr(1) []
Yup, this does what I want, for the most part.

Redirection is a problem, because it doesn't shell out, it really just executes the first argument you give it as a problem. But 'bash -c "some long command line"' works, as does '-s "pipe | line"' for pipelines.

Also, this is badass:
<code class="language-bash">$ ls *.css *.html | entr reload-browser Firefox</code>
filesystem  inotify  cli  automation  utility  sysadmin  commandline  essential  solution  webdevel  livereload  fuckina 
august 2017 by kme
NFSv4 ACLs | Department of Electrical Engineering & Computer Science
This is very important: once you have created your ACL with inherited access controls, you must then set the group field of your umask(2) to something permissive enough to allow any extra principals in your inherited list (other than the OWNER@, GROUP@, and EVERYONE@) to have the access you would like. Take a moment to let that sink in. For example, if you have an ACE like on a directory, then you need to set your umask to at most 007 (e.g. with a command like “umask 007”). If instead you only gave joeuser the RX permissions, you could set your umask to 027. No, it does not make any sense, and yes it is a bug, but it is not likely to be fixed soon.

Example: Give your research group, research1, read access to your project directory project1:

$ find project1 -type d -exec nfs4_setfacl -a "" {} \;$ find project1 -type f -exec nfs4_setfacl -a "" {} \;
filesystem  permissions  nfs4  acl  nfs4_setfacl  sysadmin  osc  solution  fuckina 
april 2017 by kme
Git for Windows - Release Notes
Many Windows programs (including the Windows Explorer) have problems with directory trees nested so deeply that the absolute path is longer than 260 characters.
yupwindows  windows  filesystem  annoyance 
december 2016 by kme
python - How do I get the path and name of the file that is currently executing? - Stack Overflow
import os
os.path.dirname(__file__) # relative directory path
os.path.abspath(__file__) # absolute file path
os.path.basename(__file__) # the file name only


down vote

The suggestions marked as best are all true if your script consists of only one file.

If you want to find out the name of the executable (i.e. the root file passed to the python interpreter for the current program) from a file that may be imported as a module, you need to do this (let's assume this is in a file named

import inspect

print inspect.stack()[-1][1]

Because the last thing ([-1]) on the stack is the first thing that went into it (stacks are LIFO/FILO data structures).

Then in file if you import foo it'll print, rather than, which would be the value of all of these:


python  filesystem  dammitbrain  solution 
june 2016 by kme
ACL Tips | Apple Support Communities
Here's a good template for a Makefile:

DIRS = one two three
WWWUSER = _www
DIRACL := file_inherit,readattr,read,writeattr,write,delete
FILEACL := directory_inherit,append,list,search,add_file,add_subdirectory,delete_child

chmod +a "$(USER) allow $(DIRACL)" $(DIRS) && \
chmod +a "$(USER) allow $(FILEACL)" $(DIRS)
chmod +a "$(WWWUSER) allow $(DIRACL)" $(DIRS) && \
chmod +a "$(WWWUSER) allow $(FILEACL)" $(DIRS)
mac  osx  acl  filesystem  permissions  sysadmin  reference  solution 
june 2016 by kme
dW:IBM developer solutions:General Parallel File System (GPFS):what means GPFS Deadman switch timer[0] has expired;Ios is Progress:0 - General Parallel File System (GPFS) Forum
It means that the node was unable to renew its lease to the cluster manager, and another 23 seconds (2/3rds of leaseDuration) have passed while waiting for reply. If there were any write IOs still pending, the machine would have rebooted, so that recovery could be run on the FS mgr node. But since there were no IOs outstanding, the node just keeps probing the quorum nodes waiting for a reply and a new lease.
gpfs  errormessage  filesystem  networking  sysadmin 
april 2016 by kme
How can I change the amount and size of Linux ramdisks (/dev/ram0 - /dev/ram15)? - Super User
In Debian, the RAM disk capability is built as a module ("brd"), so you might not see /dev/ram?? at first. Running the commands as described in this SU thread should still work, and the device files will be created as required once the module loads.
ramdisk  debian  linux  unix  filesystem  sysadmin  solution 
december 2015 by kme
osxadmin: chmod ACL removal
The command to recursively remove all ACLs from the files in the working directory and its subdirectories is:

sudo echo | sudo chmod -R -E ./*
mac  osx  acls  permissions  filesystem  sysadmin  annoyance  solution 
july 2015 by kme
Moving or rename files and directory using Linux mv command - Basic Linux Command. | Linux Windows Install Setup Configuration Project
Rename Linux files, base on file inode number.

To rename file or directory in Linux using the inode number, we need to know their inode number. Use the ' ls -i ' to find out the inode number for the files or directory.

[root@fedora ~]# ls -i
648389 anaconda-ks.cfg 97315 example-directory 1847716 install.log.syslog
97582 Desktop 1847715 install-fedora.log 648395 X.txt

Now let use the example-directory with inode number 97315 as an experiment for the example.
Now, execute the find command to find the example-directory inode number than rename that directory to new-directory-name.

[root@fedora ~]# find . -inum 97315 -exec mv {} new-directory-name \;
find: ./example-directory: No such file or directory

To verify the change on the directory name, use the ls command with the ' -i ' option to list file and folder including their inode number.

[root@fedora ~]# ls -i
648389 anaconda-ks.cfg 1847715 install-fedora.log 97315 new-directory-name
97582 Desktop 1847716 install.log.syslog 648395 X.txt
inode  linux  filesystem  sysadmin  encoding  illegalcharacters  filemanagement  maybesolution 
july 2015 by kme
« earlier      
per page:    204080120160

Copy this bookmark:

to read