I need to run software that uses "/dev/log" on MacOS. I know I can run it if I rewrite it "/var/run/syslog" but the problem is I cannot change the source code. How can I create an alias "/dev/log" points "/var/run/syslog" on my Mac? I am using MacOS venture 13.1
While I don't have a Mac to personally test this on, I believe you could accomplish this by creating a symbolic link from what your software is expecting to the socket your Mac uses:
ln -s /var/run/syslog /dev/log
Creating a test link on a Linux system this way allows me to send logs that show up in the system log. You could test this approach yourself using something like this (assuming you have a logger utility):
ln -s /var/run/syslog my-test-link
logger -u my-test-link "test my custom link"
# check your log to make sure that your test message made it through
Related
I want to know the current battery value on my phone, but I can not do this. When I enter the 'termux-battery-status' command, my terminal hangs (it doesn’t output anything).
I read on various forums about changing application settings Like this or like this.
My telephone:
$ termux-info
Packages CPU architecture: aarch64
Updatable packages: All packages up to date
Android version: 9
Kernel build information: Linux localhost 4.9.117+ #4 SMP PREEMPT Mon Jul 8 17:13:44 CST 2019 aarch64 Android
Device manufacturer: Blackview
Device model: A60Pro
Termux Settings:
I do not understand how to fix this. :/
Help me please.
Please install the Termux:API app on your device : https://play.google.com/store/apps/details?id=com.termux.api
After installation, head over to App Info for the Termux:API app, and allow all the permissions including Modifying System Setting.
Try termux-api-start command first. This is what helped me
RUN Termux-API in your phone in 2023
This will solve all the termux-api problems including Termux-battery-status issue.
Since Developers have stopped updating the playstore version of termux it is not going to work properly, so from now on we have to use termux from the f-droid website. Also, you need to install the termux-api.apk to make these api commands work. below is the simple code that can make everything work in few seconds
So firstly install termux application from F-Droid, Download link. If you are already using the F-Droid version, then skip this step.
Just copy the entire code directly and paste it inside your termux. it will open the termux-api page for you, just install it and everything will be fixed.
echo -e "\e[031m" "HEY, MAKE SURE TO INSTALL THE TERMUX API APP THEN
COME BACK AGAIN IN TERMUX" && sleep 2 && xdg-open
"https://f-droid.org/repo/com.termux.api_51.apk"&& echo -e '\e[032m'
'HAVE YOU INSATLLED TERMUX API APK? IF YESS THEN PRESS ENTER, IF NO
THEN RE-RUN THE SCRIP AND THIS TIME INSTALL THE APK IN YOU PHONE' &&
read r && pkg install "termux-api" && exit
type termux-battery-status to find the battery info.
To make everything work even smoother, go in your settings>apps> search Termux:API and make sure to allow every permission you can enable.
download termux api app from play store then you can easily use that commands its 200% true just try its only 2MB app
I'm trying to create a xulrunner app for OS X 10.9+. I need it to be standalone, i.e. to not require any extra additional software (including Firefox) to be installed on the box along with the app.
I was not able to google up an up-to-date guide on how to do that. It seems that I've hit every issue described here: https://bugzilla.mozilla.org/show_bug.cgi?id=923979
One of the last ones is:
$ open MyApp.app
LSOpenURLsWithRole() failed with error -10810 for the file /Path/To/MyApp.app.
Here is an what I have so far:
https://drive.google.com/file/d/0BxRquYs2Nx92ZTZaVjk0QThMN2c/view?usp=sharing
How can I create an OS X .app for a modern (v36+) xulrunner application?
You are on the right track, there is just one major issue you are facing.
If you were to run you application by the command line, you would get some output like this.
$ SampleApplication.app/Contents/MacOS/xulrunner
Mozilla XULRunner 33.0
Usage: xulrunner [OPTIONS]
xulrunner APP-FILE [APP-OPTIONS...]
OPTIONS
--app specify APP-FILE (optional)
-h, --help show this message
-v, --version show version
--gre-version print the GRE version string on stdout
APP-FILE
Application initialization file.
APP-OPTIONS
Application specific options
As we can see, the executable did not automatically run the Contents/Resources/application.ini like the tutorials say it will. This is a known issue, and the popular workaround among XULRunner users is to create a stub shell script to pass the required argument to the xulrunner binary.
Here is a script I've whipped up to do just that.
#!/bin/sh
runpath="`dirname "$0"`"
contentsdir="`cd "$runpath"/.. > /dev/null && pwd`"
exec "$runpath/xulrunner" --app "$contentsdir/Resources/application.ini"
Save this text to a file in your MacOS directory and give it executable permissions. For sake of example, I will use sampleapplication. Here is the command to set executable permissions.
chmod +x sampleapplication
Now, modify your Info.plist to execute this script instead of executing xulrunner directly by setting the CFBundleExecutable entry to match your stub shell script.
<key>CFBundleExecutable</key>
<string>sampleapplication</string>
Now when you run your application, it should work. If you are getting an error saying "The application cannot be opened because its executable is missing", you may want to rename the application bundle, or follow the advice in that question to avoid the caching issue.
Bonus Info
You can remove the Contents/Frameworks/XUL.framework directory, it is no longer used and placing the XUL.framework contents in the MacOS folder is now the correct place to put them.
You should also copy the dependentlibs.list file from the Contents/MacOS to the Contents/Resources directory, although XULRunner 33 seems to be getting on fine without it.
I'm wanting make use of the Libebur128 tool. It's a tool for checking loudness levels of audio files for broadcast compliance.
I've installed via homebrew:
brew install libebur128
There is however no unix executable so it can't be run by using $ebur128 [audiofile]
I've tried getting the source https://github.com/jiixyj/libebur128 and doing the following;
mkdir build
cd build
cmake ..
make
But still no executable.
Any ideas?
If you want to use libebur128 from CLI (e.g. as a tool), I would recommend checking out this project (the r128x-cli part).
I'm following a guide from The Mathematica Journal that describes how to use Mathematica with the Lego Mindstorms NXT. I have some trouble getting started and got stuck with the SerialIO package.
I use Mac OSX and I have installed the package to:
/Applications/Mathematica.app/AddOns/ExtraPackages/SerialIO/
The command Needs["SerialIO`"] gives me the following error message:
LinkOpen::linke: Could not find MathLink executable.
And trying
SetDirectory[FileNameJoin[{$InstallationDirectory, "AddOns", "ExtraPackages", "SerialIO", $SystemID}]];
Does not help either, it gives:
SetDirectory::cdir: Cannot set current directory to /Applications/Mathematica.app/AddOns/ExtraPackages/SerialIO/MacOSX-x86-64.
There seem to be some problem with the alias/symbolic link in the SerialIO folder. By default they pointed to an absolute directory on the machine that this library was built on:
MacOSX-x86-64 -> /Files/schofield/Packages/SerialIO/Build/Mac/build/Deployment/Package/SerialIO/MacOSX
I tried deleting the alias and creating a symbolic link in the terminal:
ln -s MacOSX MacOSX-x86-64
Running the SetDirectory command again result in... no result, so I guess thats good. The commands seem to have been loaded as when typing Serial it want to autocomplete to SerialOpen etc.
However, using the command mybrick = SerialOpen["name of serial port"] does not put the NXT in connected mode (<> on NXT display). Does anyone else got it to work?
There was a problem in SerialIO in combination with Mathematica9. After some correspondence in may 2013, Wolfram Support find the problem and updated SerialIO for me. It seems logical that they also update SerialIO on their site. Please have a try and download SerialIO again and update. My OS is MaxOSX.
I have installed the package ccl with Mac ports. Now I want to use the Cocoa bridge.
Welcome to Clozure Common Lisp Version 1.8 (DarwinX8664)!
? (require "COCOA")
> Error: Permission denied : #P"/opt/local/share/ccl/1.8/temp bundle64.app/Contents/252752233492590994.tem"
> While executing: %CREATE-FILE, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
If I start ccl64 with sudo it works all right. But I would like to be able to do this as a normal user. How should I do it?
svn co http://svn.clozure.com/publicsvn/openmcl/release/1.8/darwinx86/ccl
while in ~ is probably the most straightfoward way to achieve what you want.
If you'd like to work with MacPorts to manage ccl (instead of the svn method above), then run
sudo chown -R $USER /opt/local/share/ccl
Note that the latter case does make me a bit uncomfortable, because if you try to sudo port uninstall ccl, MacPorts does not completely remove the share/ccl directory, presumably because the (require :cocoa) call adds compiled binaries to that directory that Macports is not tracking.
To get the MacAppStore version to work, you'd probably need to find the ccl binary buried inside the ccl.app directory, and launch that for slime. Might not be a bad way to go either.
Note that any way you do this, once you (require :cocoa), you'll have a separate cocoa listener pop up while slime is running. I just move it off to the side once it opens. If you find a way to suppress this listener window after (require :cocoa), I'd be interested to know that.
But I'd recommend the first (svn) method. That's the one I use with slimv, and it's the one that Clozure recommends on their downloads page.
If you are on a Mac, the easiest way to run Clozure CL is to load it from Apple's Mac App Store.
https://itunes.apple.com/de/app/clozure-cl/id489900618?mt=12
That way it gets installed in the Applications folder and running the Cocoa-App is no problem, since it is provided. But then you would run the Cocoa-based IDE version of CCL.
If you install CCL from MacPorts, I guess that the App is not existing. You would need to have the rights for the directory to create the necessary files.
Otherwise I would just install a fresh CCL from Clozure's repository:
http://ccl.clozure.com/download.html