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
/home/dumiduh/pythonian/dfile5 0 0 33188 110100100 | |
/home/dumiduh/pythonian/rfile2 1000 1000 33188 110100100 | |
/home/dumiduh/pythonian/shrubbery 1000 1000 33188 110100100 | |
/home/dumiduh/pythonian/dfile4 0 0 33188 110100100 | |
/home/dumiduh/pythonian/rfile1 0 0 33188 110100100 | |
/home/dumiduh/pythonian/scriptsfolder 0 0 16877 111101101 | |
/home/dumiduh/pythonian/dfile2 1000 1000 33188 110100100 | |
/home/dumiduh/pythonian/rfile3 0 0 33188 110100100 | |
/home/dumiduh/pythonian/dfile1 1000 1000 33188 110100100 |
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
import os | |
folder="/home/dumiduh/pythonian/" | |
files=os.listdir(folder) | |
for file in files: | |
fqfilename=folder+str(file) | |
modemasked=os.stat(fqfilename).st_mode | |
uid=os.stat(fqfilename).st_uid | |
gid=os.stat(fqfilename).st_gid |
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
root@dumiduh-thinkpad:/home# python | |
Python 2.7.6 (default, Oct 26 2016, 20:30:19) | |
[GCC 4.8.4] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import os, shutil | |
>>> dir(os) | |
['EX_CANTCREAT', 'EX_CONFIG', 'EX_DATAERR', 'EX_IOERR', 'EX_NOHOST', 'EX_NOINPUT', 'EX_NOPERM', 'EX_NOUSER', 'EX_OK', 'EX_OSERR', 'EX_OSFILE', 'EX_PROTOCOL', 'EX_SOFTWARE', 'EX_TEMPFAIL', 'EX_UNAVAILABLE', 'EX_USAGE', 'F_OK', 'NGROUPS_MAX', 'O_APPEND', 'O_ASYNC', 'O_CREAT', 'O_DIRECT', 'O_DIRECTORY', 'O_DSYNC', 'O_EXCL', 'O_LARGEFILE', 'O_NDELAY', 'O_NOATIME', 'O_NOCTTY', 'O_NOFOLLOW', 'O_NONBLOCK', 'O_RDONLY', 'O_RDWR', 'O_RSYNC', 'O_SYNC', 'O_TRUNC', 'O_WRONLY', 'P_NOWAIT', 'P_NOWAITO', 'P_WAIT', 'R_OK', 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'ST_APPEND', 'ST_MANDLOCK', 'ST_NOATIME', 'ST_NODEV', 'ST_NODIRATIME', 'ST_NOEXEC', 'ST_NOSUID', 'ST_RDONLY', 'ST_RELATIME', 'ST_SYNCHRONOUS', 'ST_WRITE', 'TMP_MAX', 'UserDict', 'WCONTINUED', 'WCOREDUMP', 'WEXITSTATUS', 'WIFCONTINUED', 'WIFEXITED', 'WIFSIGNALED', 'WI |
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
/home/dumiduh/sharedfile: Permission denied | |
original file | |
pyuser1 appending | |
pyuser2 appending |
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
su - pyuser1 | |
echo "pyuser1 appending" >> /home/dumiduh/sharedfile | |
exit | |
su - pyuser2 | |
echo "pyuser2 appending" >> /home/dumiduh/sharedfile | |
exit | |
su - pyuser3 | |
echo "pyuser3 appending" >> /home/dumiduh/sharedfile | |
exit | |
cat /home/dumiduh/sharedfile |
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
groupadd filesharegroup | |
useradd -g filesharegroup pyuser1 | |
useradd -g filesharegroup pyuser2 | |
useradd pyuser3 | |
echo “original file” > sharedfile | |
chown pyuser1:filesharegroup sharedfile | |
chmod 660 sharedfile |
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
ls -l |
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
root@d1ad06cfbc91:/usr/local/tomcat# ls | |
LICENSE NOTICE RELEASE-NOTES RUNNING.txt bin conf file1 include lib logs native-jni-lib temp webapps work | |
root@d1ad06cfbc91:/usr/local/tomcat# cat file1 | |
life inside a container |
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
docker container start d1ad06cfbc91 | |
docker container exec -it d1ad06cfbc91 bash |
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
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
d1ad06cfbc91 tomcat:8.0 "catalina.sh run" 7 hours ago Exited (143) 16 seconds ago fervent_stone |