Installing GPG tools via terminal on mac - terminal

I am trying to install gpg tools on a mac mini i have ssh access to so i can then install s3cmd.
I know you can use the installer dmg here http://www.gpgtools.org/installer/index.html
But as i only have ssh access i need to install this via terminal and cant findout where to do this if i click source it take me to this page https://github.com/GPGTools/GPGTools which isnt helpful to me.
Can someone point me in the right direction.

This is hardly a gpg specific question, it should be asked an OSX systems support section, however, I will answer the best I can, but specific only to the installing GPGTools for OSX (the process for installing other dmg/pkg's on OSX might differ).
# Move to a location we can work
cd /tmp
# Retrieve the DMG for GPGTools
wget https://github.com/downloads/GPGTools/GPGTools/GPGTools-20120318.dmg
# Mount the DMG image so we can access it's contents;
# NOTE: the last line of the output describes where the image was mounted.
hdiutil attach ./GPGTools-20120318.dmg
# Move into the the mounted image
cd /Volumes/GPGTools/
# Now begin the installer as root, with a target of "/"
sudo installer -pkg GPGTools.mpkg -target "/"
# Now we must fix the permissions of our gnupg directory, as the installer
# script seems to "fix" the permissions with the root user
sudo chown -R `whoami`: ~/.gnupg
# Now move out of the mounted volume directory so we can unmount it
cd /tmp
# Unmount the volume
hdiutil detach /Volumes/GPGTools
GPGTools should now be installed.

Related

cannot mount usb partition - unknown file system exfat

I have a USB stick with important info that would not show up in Windows. I tried the Disk Management Utility, and the partition with the data shows up as "healthy", but no drive letter, and right-click menu options all grayed out (except 'delete'). I used another laptop, I used a Macbook, all to no avail.
On Ubuntu, it also would not show up. I tried manual mounting, which did not work, and on parted it the "File system" column is empty.
Using fdisk -l it shows as HPFS/NTFS/exFAT.
???
I thought to remove my question, but since it took me a while to find the answer, others may benefit:
sudo apt install exfat-fuse exfat-utils
Now I could mount it with exfat specified as file system (and anyway now Ubuntu also automatically mounted it).
uanble to mount exfat file system then needs to follow below steps
Open a terminal (Ctrl+Alt+T shortcut in Ubuntu).
sudo add-apt-repository universe
sudo apt update
sudo apt install exfat-fuse exfat-utils

Is gvfs-trash installed? in Atom

When I tried to remove a file in local machine to check files are synchronous with vagrant development server it pops up an error:
The following file couldn't be moved to the trash.
Is gvfs-trash installed?
For solving it I created a trash directory that can be accessed from outside the user’s home directory:
# Create a Trash directory (with some subdirectories) in root
sudo mkdir -p /.Trash-1000/{expunged,files,info}
# Give ownership of this to your user:
sudo chown -R $USER /.Trash-1000
Still I can't remove the file from local machine. But If I delete a file at vagrant development server it automatically deletes at local machine, opposite is not happening and ends-up with this error "Is gvfs-trash installed? "
Like YuriAFGomes said, everything seemed to work fine in my system: trash folder had the right permissions and gvfs-trash worked flawlessly from command line, yet atom 1.45 said it couldn't delete any file. Tried to start atom with sudo and it didn't fix anything. Tried creating the .Trash-1000 directories in several places, and nothing, same error related to gvfs-trash. I'm pretty sure this used to work fine in my atom setup and suddenly it stopped doing so, and I have no idea why. I went to their releases list and tried downgrading to several of them until I settled with version 1.30, which doesn't seem to have this issue and is compatibles with my local packages. If you have this problem and tried everything said around the web, I suggest you try downgrading to different versions until the problem goes away.
There is an issue on GitHub reporting this problem. According to the report, a missing .Trash-1000 can cause this problem, so you can create it as follows.
mnt=/; id=$(id -u); sudo mkdir -p "$mnt/.Trash-$id"/{expunged,files,info} \
&& sudo chown -R $USER:$USER "$mnt/.Trash-$id"/ \
&& sudo chmod -R o-rwx "$mnt/.Trash-$id"/
Set mnt to the mount point, where gvfs-trash is expecting it.
Simply cd to the directory which will be opened in atom and execute df ..
This will give something like this:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb1 960380628 463122460 448403708 51% /mnt/vol
In this example, the mount point and the value of mnt would be /mnt/vol.
What solved this issue for me was uninstalling atom via dpkg and installing it via apt from the following PPA: https://launchpad.net/~webupd8team/+archive/ubuntu/atom . I have no clue why this works, though. I have noticed that the PPA installs atom 1.26, while the version where the issue arised, installed via dpkg, is 1.45.
Before doing that, I have tried creating the .Trash-1000 directories in root, in home and in project folder, with the proper permissions. gvfs-trash was installed, updated and working as expected all the time, but the problem persisted. Really odd.
The real problem is that atom/electron are/were using gvfs-trash which has been deprecated for almost 5 years. Electron which is the platform on which Atom is built has fixed this in the development branch but hasn't backported it to the 2.0 branch on which Atom is based.
Solution/Workaround as of now?
Use an environment variable $ELECTRON_TRASH and set it to gio or one of the alternatives
See if you are missing the .Trash-1000 folder (assuming your uid is 1000)
Install an alternate gvfs-trash script to take over the missing functionality
Delete the file/folder outside of atom
I had a similar problem on Windows using Atom, where I couldnt delete the files. So I resorted to deleting them manually from the directory (outside of Atom).
Turns out atom cannot "move to trash" if u checked in recycle bin this option:
"Don't move files to the Recycle Bin. Remove files immediately when deleted."
Just set the other option (to move files to actual recycle bin) and should work.

Operation not permitted and permission denied

My mac version is 10.12.2.
I'm trying to install R studio and a number of other softwares, but it doesn't work. I suspect it's because of permission issues - my mac doesn't allow them to create directories during installing.
~$ pwd
/Users/biona001
~$ mkdir fdsa
mkdir: fdsa: Operation not permitted
but if I'm in a higher director, it says something different
~$ cd ../
Users$ pwd
/Users
Users$ mkdir fdsa
mkdir: fdsa: Permission denied
and if I move into a lower directory, it works
Users$ cd biona001/Documents/
Documents$ mkdir fdsa
Documents$
I googled almost everything without finding anything that worked, including the one where I boot my mac into this weird mode and type some command. I should be the administrator of this mac.
R Studio is installed by dragging the application to your applications folder. It requires R to be installed. R can be installed from a package, so you don't need the command line.
The 'administrator' on the mac, does not have permission to write files or create folders anywhere. It's not a good idea in any case.
If it's absolutely necessary, you must enable 'root' and login as root. But this is not necessary to use R Studio and R.
Enabling root access without knowing exactly what you are doing is a recipe for disaster.
I had the same "operation not permitted" issue on MacOS Sierra.
Looking at the user's home folder in Finder as John Elemans recommended, showed that the home folder was locked. Unchecked the locked checkbox in finder and was able to create a subfolder in the user's home folder via terminal.

wkhtmltopdf opens an application on OSX and doesn't finish its job till I focus this application

As far as I read wkhtmltopdf is using a patched version of Qt so that it can be executed WITHOUT using a graphical server such as Xorg, etc but when I run it in my OSX, it opens an application, it's visible in dock and when I press Command-Tab it's visible in list of applications shown, the icon of this app is a text "exec" in a black background. As soon as I focus this app it gets closed and wkhtmltopdf finishes its job but if I don't focus it, it doesn't finish its job at all.
Any ideas what can I do? I want it to run in background and respond automatically, I can't sit behind the system and Command-Tab each time a request is sent.
Update:
I tried it with an Ubuntu Server and it raises this error:
wkhtmltopdf: cannot connect to X server localhost:10.0
when I try to run wkhtmltopdf directly in command line. Isn't it against to whole purpose of patching Qt so that it doesn't need an X server?
It got solved after I faced the problem in Ubuntu, by searching the error raised in Ubuntu I could find this post wkhtmltopdf: cannot connect to X server which seems led me to install the package from sourceforge (both in OSX and Ubuntu) and it solved my problem (both in OSX and Ubuntu)
You must copy it into directory : /usr/local/bin, make sur it's executable and add symlink of wkhtmltopdf.sh like :
1- the command :
brew cask install wkhtmltopdf
2 - insert the binary in directory /usr/bin so the browser can't have permission to execute in this directory.
You must copy the wkhtmltopdf.sh to directory /usr/local/bin cause the browser have permission in this directory like:
sudo cp /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf.sh
3 - After make sur the binary have permission of execution like :
sudo chmod a+x /usr/local/bin/wkhtmltopdf.sh
4 - so now you can test, it's work like:
/usr/local/bin/wkhtmltopdf.sh http://www.google.com google.pdf
it make download the pdf in the current directory in your terminal
5 - Optional
now you can add symlink in your directory /usr/local/bin like
ln -s /usr/local/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
6 - copy to the /usr/bin/wkhtmltoimage into /usr/local/bin/wkhtmltoimage like:
sudo cp usr/local/wkhtmltoimage usr/local/bin/wkhtmltoimage
8- make sur this is executable too:
sudo chmod a+x /usr/local/bin/wkhtmltoimage
I Hope it's help you

Removing GRUB from sda from Mac Internet Recovery

I tried to make a bootable Ubuntu DVD on my MAC. This lead to messing up my bootloader which I have been unable to fix.
https://discussions.apple.com/thread/3109456?tstart=0
One person states
Boot OSX and in the terminal write:
mkdir mnt ; sudo mount -t msdos /dev/disk0s1 mnt
Will show a new drive EFI
Open this drive and open the folder EFI
Inside you will have the folders APPLE and UBUNTU
Just delete the UBUNTU folder
So I keep reading and see
When in -Recovery From Internet- it is impossible to use mkdir, but
you can "cd /tmp" and mount it there.
So I haven't been able to figure out how to mount disk0s1 in the /tmp. If someone could please show me the commands to get into the EFI Folder so I can delete the Ubuntu folder.
I assume the link means you can do something like:
mount -t msdos /dev/disk0s1 /tmp/
then
cd /tmp
and you should see the APPLE and UBUNTU directories. I am not in Recovery Mode now so I can't try that, but deleting UBUNTU from there may help you.
This page:
http://www.rodsbooks.com/refind/getting.html
is what I use when I want to install Linux on a Mac, and has a lot of useful explanation about EFI booting on Mac machines. I have had good luck with SuperGrub2 when I've gotten in trouble:
http://www.supergrubdisk.org/category/download/supergrub2diskdownload/super-grub2-disk-stable/

Resources