New answers tagged

0

By accident I came across ACL, with that I could solve my problem. On the Mac side I made a new Group with the same GID as the one in Linux. Terminal didn't work for me, I had to make a group in the System Preferences / Users & Gropus and added my Mac User to it. Then I set the ACL in order that all new content belongs to the Linux User Group. sudo ...


1

I was working on something similar the other night. My setup is a little different in that I do not use a home directory, each LVM is mounted at its own root level directory but a few things that may help: In the [Global] section, i enforce a minimum SMB level using: [Global] min protocol = SMB2 If you are running SMB 4 you could also set SMB3 as a ...


0

Here is how I would do it using P.E. and bash syntax. while read -r vmname uuid; do uuid=${uuid##*'{'} uuid=${uuid%'}'*} vmname=${vmname#*'"'} vmname=${vmname%'"'*} printf '%-15s %s\n' "$vmname" "$uuid" done < <(VBoxManage list vms) You can start the vms inside the loop with a match using a test or save the output in array and so on. It ...


1

Have you tried telling SELinux on the server that the directory may be accessed by Samba? It might be as simple as telling SELinux that sharing of home directories is allowed: setsebool -P samba_enable_home_dirs 1


0

$ VBoxManage showvminfo 'Test Machine' --machinereadable | sed -n '/^UUID=/{ s///; s/"//gp; }' 1ce7ffef-8faa-4138-9b92-466698762f62 Instead of using the list vms sub-command, this uses the sub-command showvminfo, which gets all the information for a particular machine (here a VM called Test Machine). With --machinereadable, this outputs the data in a form ...


0

Just an idea of how to go about your question. I have not tested this one zippo() { local n=1 local f for f; do if [[ -e $f.zip ]]; then echo ditto -c -k --sequesterRsrc --keepParent "$f" "${f}-${n}.zip" ((n++)) else echo ditto -c -k --sequesterRsrc --keepParent "$f" "$f.zip" fi done } Like I said untested ...


0

You are not supposed to leave the < and > symbols in, they are there to annotate that you need to replace that string. When left in bash is treating them as redirection operators. You are using the command: curl http://<192.168.1.117>:8081/zeroconf/signal_strength -XPOST --data '{"deviceID":"<deviceID>","data":{} }' But you should have ...


0

VBoxManage list vms| awk -F "{" '/Test Machine/{gsub("}","",$NF);print $NF}' output 9d0953a7-ca2a-4667-8c5b-1a9f550b2956


0

With the BSD date supplied in OSX, you can timestring="2020-01-17T06:41:48.456Z" /bin/date -jf "%Y-%m-%dT%H:%M:%S" "${timestring%.???Z}" "+%s${timestring: -4:3}" 1579261308456


1

You can install coreutils which contains GNU date : brew install coreutils then $ gdate -d "2020-01-17T06:41:48.000Z" +%s%3N 1579243308000


5

My first guess would be that you have files that have been deleted, but are kept open by a running process. Use sudo lsof | grep Contents - this should give you all the PIDs that have files open with names containing the word 'Contents'. Here's the first couple of lines of the output to show you the headers: $ sudo lsof | head COMMAND PID TID ...


0

Try rebooting. It may be that you have a process which still has a deleted file open in Contents directory. A reboot will release the file and you will be able to delete the directory.


8

The directory entries . and .. are an artefact from the early 1970s, when UNIX did run on tiny machines and code needed to be tiny as well. So the people created real hardlinks to directories named . and ... This bad idea causes the hard link count of an empty directory to be 2. Today, this is nonsense and the POSIX definition since 1988 is that these ...


-3

In Linux if you create folder any where as root or user within user's directory there are 2 default directories created by system which . and .. which are hidden and you can not remove/delete at all. (.) is referred as current folder and (..) previous folder. (.) you require when you want to execute script from current directory (..) you required when you ...


31

Your directory looks empty, but the ls output indicates that there is a file in there since the link count for the directory is 3 rather than 2 (an empty directory on an APFS filesystem should have a link count of 2). This implies that your filesystem has managed to get itself into an inconsistent state and that you should probably run fsck on it. On macOS,...


-3

If you are sure you want to remove the Contents directory, you can use: sudo rm -r -f Contents This will pass the recursive parameter (which removes directories, removing the contents recursively beforehand) and will use the forced parameter (which ignores non-existent files and overrides any confirmation prompts). Note that this can not be undone. (for ...


3

There are a couple of options to skip searching within the file being created. Create the file in a directory that is not within the tree being searched. Example: grep WindowsIdentity -r > ../windowsid.txt Use the --exclude option. Example: grep WindowsIdentity -r --exclude=windowsid.txt > windowsid.txt


2

With Gnu grep (uses Perl-stye regex): grep -Po "(?<={)[a-f0-9-]+(?=})" ... in other words, any sequence of hex digits and dash, occurring after an opening brace and immediately followed by a closing one. With plain grep grep -Eo "([a-f0-9-]+-){4}[a-f0-9-]+" ... ie, 5 groups of hex digits separated by dashes.


3

Another way. VBoxManage list vms | awk -F ' ' '{print substr($2, 2, length($2) - 2)}' Separate fields by empty space awk -F ' ' Print second column removing the first { and last } characters '{print substr($2, 2, length($2) - 2)}'


7

-F field separator in awk. Here we are using 2 field separators. (either { or } ) VBoxManage list vms | awk -F"[{}]" '/Test Machine/{print $2}'


1

Unbelievable, I spent a week with my kind TA trying to solve this issue with no luck. I just got it to work. Here is what I did (hopefully it will work for you too): Open up Wing IDE. Go to Edit -> Configure Python... Ensure that Python Path, Environment, and Initial Directory are untouched. Change Python Executable at the top to Custom. Click the Browse ...


1

For security reasons, you need to be root (as root user or via sudo) to change the ownership of a file or directory. If you are root, it is simply chown jenkins /a/b chgrp jenkins /a/b EDIT: I am not a Mac user, but I understood that the command on a Mac would be dscl, as in: sudo dscl . create /Groups/jenkins sudo dscl . create /Groups/jenkins RealName "...


0

If you want a list of the interfaces you can use netstat -i


1

ifconfig is probably the tool you're looking for. You can also use: networksetup -listallhardwareports Although this won't give as much detail


0

Your Chromium build is trying to access some X11 extensions the XQuartz does not support. Your best bet here is to use a nested X server so that server will support the functions locally. If you are using a VM to do this, I recommend setting up VirGL as your rendering path instead. It is much faster.


3

Sparse files may be expanded on copy when the -S flag is not used. (Will make the destination take more space) Hard links within the tree may be expanded to separate files on copy when the -H flag is not used. (Will make the destination take more space) Filesystems may have different allocation sizes. A one-byte file may take up 512 bytes of disk ...


1

o isn't a filter on BSD top, it's a sort. o Change the order in which the display is sorted. The sort key names include cpu, res, size, time. The default is cpu. I'm not sure if there is a way to filter it the way you want. So you could press o then type COMMAND but COMMAND=iTerm2 is invalid. Alternatively you could run top with the -...


1

Regarding the first question- it’s just setting an environment variable for the program. You could achieve the same by first exporting the variable. Regarding the second question- you have to source (either use the keyword ‘source’ or a dot) the file for it to affect the current session. easiest might be to add ‘export’ before each line in the file, then ...


0

If you want to see all the files that any process named 'bash' opens directly, you can do something like this: $ sudo dtrace -n 'syscall::open*:entry/execname == "bash"/{ trace(copyinstr(arg0)); }' You may, alternatively, want to see all the files opened between when bash starts and you get to the prompt. For that, you could do something like this: $ sudo ...


0

according to nmap --help on my MacBook Air: --script=<Lua scripts>: <Lua scripts> is a comma separated list of directories, script-files or script-categories so it looks like you need --script=vulners


1

I think you have missed some of the more common tools in your search. For some testing I find IOrate(port) nice. Previously bonnie++ was very common. Still a favourite for testing disks but see Can I determine IOPS on a disk array using bonnie++?. Today I would say that iozone(port) is mostly used. And it helps you with IOPS See How to properly test SSD ...


2

One way to do this is to trace the system calls made by the program, and filter for open/openat system calls, or name lookup. The original two tools for this were truss on AT&T Unix System 5 and ktrace on 4.4BSD. (The latter pairs ktrace with kdump which translates the machine-readable output to human-readable form.) A later invention, a couple of ...


7

Sourcing an rc file rarely if ever works in practice, because people rarely write them to be idempotent. A case in point is your own, where you are prepending the same directory to the fpath path every time, which of course means that searching that path takes a little longer each time. No doubt this isn't the only place where you are doing that sort of ...


5

While autoload marks a name for autoloading on first reference in zsh, it doesn't redefine any existing function with the same name should it already be defined, since the name has already been referenced once it was defined. in order to achieve what you desire, you would have to undefine the function first before sourcing .zshrc again or for something more ...


0

Using sublime is not recommended, but simply the blog author's personal preference. The official Sublime Text documentation uses subl and (I guess) most people do. However, you can use whatever suits you best. It won't be problematic until another software uses the same name for its binary.


0

If you run this command : open -a Finder ~/Library/Preferences/com.apple.Terminal.plist You'll see a CommandHistory tab where you can remove entries. If com.apple.Terminal.plist is not in above path, you can search it by : find ~ -name com.apple.Terminal.plist


0

Your problem is the records in .netrc file. You have it for the first host and not for second host. What you can do is to add such record for second host. The expected format is: machine <host name> login <user-email or anonymous> password <user-password or some mail for anonymous access> Depend of the OS the required record can be: ...


0

I have since found out that zsh does have a hook which means I can remove all instances of bash shell since the system $PATH is being sourced from etc/profile anyway. macOS default shell is now zsh so for me, there is no use for bash files.


1

The shell initialisation code that you show does not look bash-specific and should work with zsh as well, assuming that the various script that it sources are working too (shell.bash and conda.sh). If there is a shell.zsh script you could obviously choose to use that instead of shell.bash. In the zsh shell, the PATH variable is tied to the path array. You ...


1

You need to publish port to link the host port to your container port, this is the most common way. Don't know flask but this should work docker run -it --publish 80:80 ubuntu bash --publish (or -p) will allow you to map a host port to a running container port https://docs.docker.com/config/containers/container-networking/#published-ports You also can ...


3

cgroups is a Linux kernel-specific feature, so you won't find it on your Mac.


0

This is actually deceptively simple and I'm shocked nobody else has offered this answer yet, so here I go Using the following for example... $ mkdir foo $ mkdir bar $ mkdir ./bar/foo $ touch ./bar/foo/file1 && touch ./bar/foo/file2 && touch ./bar/foo/file3 $ ls ./ bar/ foo/ $ ls ./bar/foo file1 file2 file3 Now comes the magic part $ mv ./...


Top 50 recent answers are included