Emacs org files encryption in MS Windows - encryption

I would like to encrypt my org files(org-mode) or a region of the file in emacs. The option given in the tool does not work (gives me the error apply: Searching for program: no such file or directory, gpg). I guess because I am using emacs on windows and all the search on this topic point towards encrypting the files on UNIX platform. Can you please help me on how encryption can be achieved on windows. Thanks in advance.
I am using ergoemacs for windows downloaded from http://ergoemacs.org/index.html. The version is as follows:
GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-29 on MARVIN ErgoEmacs distribution 2.0.0

Install GnuPG onto your Windows machine. Binary versions (i.e. ones that you don't have to compile yourself) are available from http://gpg4win.org/.
Once GnuPG is installed, and assuming you add its binary directory to your Windows %PATH%, Emacs should be able to use it.

solved the problem by installing cygwin (which has GPG installed) and using the same in emacs.
This can be done by giving the cgywin installed directory in the option cygwin-root-directory of the emacs editor

Related

Execute this command line in Windows

I'm trying to connect my firebase auth to an expo project.
I'm following the main docs of each library. I'm stucking on this step.
I'm not able in windows to exeute this command line openssl rand -base64 32 | openssl sha1 -c.
I've tried with the specific https://code.google.com/archive/p/openssl-for-windows/downloads but I don't know how to reproduce the same line.
Any help would be great, thanks in advance.
You need to install openssl. It is usually available on Linux (which I think that article might have been written for). There are some Windows binaries available at here. Alternatively, you could setup a WSL session, and run the command from there.
that is a linux command. Therefore a linux terminal is needed.
there are at least 2 ways to get this done
using virtual machine with ubuntu or some other operating system that uses a linux terminal aka shell (which I doubt you know about)
OR
installing a linux emulator (windows 8+ since it's from the windows store)
assuming you would prefer option 2, go to the windows store, search "Kali" and you will find an app called Kali. install it and if an error shows up, here's a nice video here that talks about solving that error and you would have a kali terminal on your windows computer (your command would work there)

How to build qpdf on Windows?

When running the checks for my R-package (via devtools::check()) I face the warning ''qpdf' is needed for checks on size reduction of PDFs. I found this question were it was suggested (if I understood the answer correctly) to run Sys.which(Sys.getenv("R_QPDF", "qpdf")) and see whether qpdf is found or not. In my case this just returns
qpdf
""
so, I think I didn't install qpdf correctly. Unfortunately it seems to be quite complicated to install qpdf on Windows. My first side question is: does it really is so painful and complicated to install qpdf for Windows or is there an easy solution?
I've followed the instructions until it is said to add C:\MinGW-w64\bin and C:\MinGW-w64\lib\mingw to the PATH variable. But then I don't find further specific instructions to install qpdf, only about how to build qpdf with different other programs. The second side question is: is my assumption correct that after I've build qpdf it is installed? But the real question is: What is the best way to build qpdf? I tried the ./config-mingw32 and ./config-mingw64 commands from the section "Building with MinGW" in my C:\MinGW\msys\1.0\bin\bash.exe but got the error messages ./config-mingw32: No such file or directory and have no idea how to fix this issue.
I'm using Windows 10, R version 3.3.2 Patched (2017-01-07 r71934) -- "Sincere Pumpkin Patch" and RStudio 1.0.136.
You basically do not need to build the file on windows. Please follow three steps below:
Download qpdf for windows from https://sourceforge.net/projects/qpdf/?source=typ_redirect
Extract files in a temp folder
Copy the contents of the bin folder to %SystemRoot%\System32
job done!
Sys.which(Sys.getenv("R_QPDF", "qpdf"))
qpdf
"C:\\WINDOWS\\SYSTEM32\\qpdf.exe"
To flesh out an answer provided elsewhere:
If you are running the 32-bit version of R, it is important that you download the 32-bit version of qpdf, which is the version linked from the SourceForge homepage. If you are running a 64-bit installation of R, you will need to do a bit of digging to locate the 64-bit version of qpdf, which is buried a little more deeply (version 10.0.1 is listed here).
Rather than copying files to C:/Windows/System32, a potentially safer option is to extracted the zipped qpdf directory to C:\Program Files. If you do this, you'll need to add C:\Program Files\qpdf-version_number\bin to your system PATH under the environment variables.
To do this within R, run Sys.setenv('PATH' = paste0('C:\Program Files\qpdf-version_numer\bin;', Sys.getenv('PATH')))
To do this in Windows, open the start menu, type "edit the system environment variables" to open the System Properties, and at the bottom of the "Advanced" tab click "Environment variables". Find the "Path" entry under "System variables" and click "Edit". Then, re-start R so it picks up the modified PATH.
One further step may be required to convince Windows that pqdf is safe to run.
Navigate to C:\Program Files\qpdf-version_numer\bin and execute qpdf.exe (by double-clicking). Windows 10 throws up a security warning, as it's an unrecognized executable file. You'll need to use the more options link to find the button to run the program. This done, Windows will recognize the file as safe to run and allow other software, including R, to use it.

Converting MP3 file to WAV

Is it possible to convert a file from .mp3 to .wav in R in order to be able to play the song with R?
Yes (probably). Here's an example:
Converting MP3 to WAV is pretty straightforward:
library(tuneR)
r <- readMP3("04 Trip to Paris.mp3") ## MP3 file in working directory
writeWave(r,"tmp.wav",extensible=FALSE)
(to install tuneR on Linux, see here).
Playback is harder and platform-dependent. tuneR::play() tries to use an external player.
On Windows it tries to guess:
If under Windows and no
player is given, “mplay32.exe” or “wmplayer.exe” (if the
former does not exists as under Windows 7) will be chosen as
the default.
On MacOS, specifying "open" probably works.
On Linux, specifying "play" probably works if you have the sox package installed (sudo apt-get install sox).
So on my MacOS system
tuneR::play("tmp.wav","open")
works.
An alternative that does not use external resources is audio::play().
library(audio)
w <- load.wave("tmp.wav")
play(load.wave("tmp.wav"))
It works on MacOS. I don't know if it works on Windows. It does not work on my Linux system; audio doesn't even install unless you sudo apt-get install portaudio19-dev first, and works poorly even once installed.
(When I say "Linux" here I mean the only system I've tested, Ubuntu 14.04. The sudo apt-get install ... incantations I've listed are likely to work on other reasonably recent Debian-based systems, but ... ???)

Shared library present with different name

I compiled my program with gcc using openssl crypto library.
I moved the executable to an other system, and after installing openssl tried to run it. I got the following error:
error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
What I understand from the following the library is present, but has another name:
locate libcrypto
/usr/lib64/.libcrypto.so.1.0.2f.hmac
/usr/lib64/.libcrypto.so.10.hmac
/usr/lib64/libcrypto.so
/usr/lib64/libcrypto.so.1.0.2f
/usr/lib64/libcrypto.so.10
/usr/lib64/pkgconfig/libcrypto.pc
Can I somehow tell the binary to use one of the present libraries? Or is there a way to install the one which is required?
The compilation was done on Ubuntu 15.10 64 bit, tried to run on Fedora 4.2.3-300.fc23.x86_64.
Can I somehow tell the binary to use one of the present libraries?
No, you can't: there is a reason these libraries have a different name: they are not ABI-compatible. If you managed to somehow tell the binary to use the other library, the result will be a crash if you are lucky, or a silent corruption if you are not.
(BTW, you can try this by creating a symbolic link: ln -s libcrypto.so.1.0.2f libcrypto.so.1.0.0, but you've been warned not to do this).
is there a way to install the one which is required?
Sure: you should be able to copy libcrypto.so.1.0.0 from Ubuntu machine to Fedora one, assuming you can't find a Fedora package that provides it.

How to install ESS on Mac OS X

I am trying to use Emacs instead of R on my Mac machine. I've been looking online how to install ESS so that I can use R in Emacs. But I am really confused by the installation manual which says,
Extract all the files from ess-VERSION.tgz into the directory PREFIX/site-lisp where
PREFIX is appropriate for GNU Emacs on your system; PREFIX will most likely be
either /usr/share/emacs or /usr/local/share/emacs (on Mac OS X, PREFIX will
most likely be something like /Applications/Emacs.app/Contents/Resources):
Where do I find this: /Applications/Emacs.app/Contents/Resources. I looked at Applications folder and it only contains the application file emacs.
Mac applications are bundled in folders with the .app extension. These folders are handled in a special manner by the finder which hides their contents. (See https://superuser.com/questions/78176/how-do-mac-app-execution-files-work for info). Specifically in you case /Applications/Emacs.app is really a folder. To get to its contents right click on it and choose "Show package contents". You will be able to get to /Applications/Emacs.app/Contents/Resources from there.
The ESS documentation recommends using a modified version of Emacs, which includes ESS and a few other packages. It is available for Windows and Mac.

Resources