How to use XULRunner to run SQLite Manager outside of Firefox in Mac OS X Lion? - sqlite

I have installed XULRunner 11.0 (xr) from here:
Downloads - sqlite-manager - Extension for Firefox and other apps to manage any sqlite database - Google Project Hosting
I have followed the steps listed here:
kiveo - Mac SQLite Manager Standalone App
I have read and tried the suggestions here (though they're for version 6.0):
stackoverflow: How to Install and run a XulRunner Application on Mac OS X?
I am able to get the help listing with this command:
/Library/Frameworks/XUL.framework/xulrunner-bin -h
I am able to run the app from Firefox using this command (after changing the max version in sqlitemanager-xr-0/application.ini to 11.0 from 11.0a1):
/Applications/Firefox.app/Contents/MacOS/firefox --app ~/Downloads/sqlitemanager-xr-0/application.ini
Here are the contents of the application.ini file:
[App]
Name=sqlite-manager
ID=SQLiteManager#mrinalkant.blogspot.com
Version=0.7.7
BuildID=201111132204
Vendor=lazierthanthou
Copyright=Copyright (c) 2008 - 2011 lazierthanthou
[Gecko]
MinVersion=2.0
MaxVersion=11.0
[XRE]
EnableExtensionManager=1
When I run the following command in Terminal, with or without sudo, it just immediately returns to the command prompt. There are no error messages. No application appears under Applications. Nothing seems to happen at all. (And, despite the stackoverflow page above noting that --install-app may not really be supported, it is in the XULRunner help listing - which I guess doesn't necessarily mean it'll work ;)
/Library/Frameworks/XUL.framework/xulrunner-bin --install-app Downloads/sqlitemanager-xr-0/ /Applications
Following a suggestion below, I checked for an exit code. The line above is returning 2.
Help?

Just like you did with Firefox, this command should run your app:
/Library/Frameworks/XUL.framework/xulrunner-bin --app ~/Downloads/sqlitemanager-xr-0/application.ini
Also, the --app switch is optional within XULRunner.

Here's how you can make a self-contained application you can run from the Dock.
Use the xulrunner --install-app command to create the application and then copy all contents of XUL.framework/Versions/Current into the generated application at /Applications/sqlite-manager.app/Contents/MacOS.
You can then create a wrapper script that runs the xulrunner within the generated app with the application.ini file as described here.
For example, put the following into sqlite-manager.app/Contents/MacOS/sqlite-manager and make it executable.
#!/usr/bin/env bash
APP_PATH="/Applications/sqlite-manager.app"
"$APP_PATH/Contents/MacOS/xulrunner" --app "$APP_PATH/Contents/Resources/application.ini"
Now you have to tell OS X to run sqlite-manager instead of xulrunner. You can do that by editing sqlite-manager.app/Contents/info.plist and setting CFBundleExecutable to sqlite-manager like this:
<key>CFBundleExecutable</key>
<string>sqlite-manager</string>
The only limitation of this approach is that it breaks when you move the application or rename it. I'd love suggestions on how to get rid of the absolute path within the sqlite-manager script.

try this:
firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul
or on OS X
/Applications/Firefox.app/Contents/MacOS/firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul
(found on http://www.egeek.me/2013/09/07/how-to-run-sqlite-manager-with-a-single-command/)
works fine for me on UBUNTU 12.04 to start sqlite manager without starting firefox first

If the install was successful, I think the app should be available in some usual place for your system (which wasn't mentioned, but I'm guessing OSX :). Have you looked under /Applications?
To see whether the command failed quietly, you could check its return value. Is there a verbose switch?
$ cd narnia
bash: cd: narnia: No such file or directory
$ echo $?
1
$ cd .
$ echo $?
0
$ cd narnia && echo "success"
bash: cd: narnia: No such file or directory
$ cd . && echo "success"
success

Related

Fedora 30: GTK fails to load appmenu-gtk-module

I am learning to program in Python and Rust. On different versions of Ubuntu these programs compiled and ran perfectly. Now that I have a dedicated Fedora 30 KDE system, every time I try and build a program, I get a warning: Failed to load module "appmenu-gtk-module"
I have tried looking this up and have re/installed anything GTK on my system. The programs otherwise function well, but no menus are drawn. I was also trying things in GNOME and hit the same thing.
I am also using QT. Those programs also build and run fine, but again, no menu.
I'm going bonkers with this. Any help is appreciated.
The appmenu-gtk module is not packaged on Fedora. (GNOME doesn't support them anyway.)
The real questions are:
Why is it configured to load? Did you copy or share GTK config files from an Ubuntu system? You should remove this module from your settings.
Even with improper configs I don't believe this should result in menus not appearing. It should just fail to load and work as normal. How is your application using menus?
I finally got so fed up with getting this error that I went full nerd-diagnosis, and ran this command to find out which file contained the errant reference to the appmenu-gtk (the package that would provide this is not installable on my system either).
(Replace "dolphin" with the command that is giving you the error.)
strace -e openat,access dolphin 2>&1 |grep -v ENOENT |awk '/appmenu-gtk/ {exit} !/appmenu-gtk/ {print}'|cut -d '"' -f2 |sort|uniq|xargs grep appmenu-gtk 2>/dev/null
This will then give you a list of files which contain the line appmenu-gtk, and in my case it was ~/.config/gtk-3.0/settings.ini. From there I just commented it out, and that gets rid of the error message (not sure if this will fix your problem of not having any menus, but you might just be able to edit that line to fix it in another way if commenting it out doesn't work).

How do I make jigsaw run in windows 10 ?

$ ./vendor/bin/jigsaw init
When I type that on my terminal (cmder), I get a
'.' is not recognized as an internal or external command, operable
program or batch file.
error
I was too using CMDER to initialize the Jigsaw files.
I don't know why the CMDER can't initialize the files but when I changed the terminal to GitBash, it was working.
I think this is because the GitBash terminal uses the $ sign and CMDER uses lambda (λ) sign. This is just a theory. I am still not sure.
Change the cmd line and just do this from your directory.
Example - directory is a blog
cd blog
vendor/bin/jigsaw init
A message will be flashed :
Your new Jigsaw site was initialized successfully.
Done!
You don't have to touch the files in the composer directory.
replace the / with \
like this ./vendor/bin/jigsaw init
to
.\vendor\bin\jigsaw init
That worked for me.
On windows you can try and use:
C:\Users\"COMPUTER NAME"\AppData\Roaming\Composer\vendor\bin\jigsaw
this should work - let me know if it doesn't. Also have you tried the command without the '.' like so:
/vendor/bin/jigsaw init
to be honest option 1 is your best best.

How do I enable python35 from Software Collections at login?

I followed the Software Collections Quick Start and I now have Python 3.5 installed. How can I make it always enabled in my ~/.bashrc, so that I do not have to enable it manually with scl enable rh-python35 bash?
Use the scl_source feature.
Create a new file in /etc/profile.d/ to enable your collection automatically on start up:
$ cat /etc/profile.d/enablepython35.sh
#!/bin/bash
source scl_source enable python35
See How can I make a Red Hat Software Collection persist after a reboot/logout? for background and details.
This answer would be helpful to those who have limited auth access on the server.
I had a similar problem for python3.5 in HostGator's shared hosting. Python3.5 had to be enabled every single damn time after login. Here are my 10 steps for the resolution:
Enable the python through scl script python_enable_3.5 or scl enable rh-python35 bash.
Verify that it's enabled by executing python3.5 --version. This should give you your python version.
Execute which python3.5 to get its path. In my case, it was /opt/rh/rh-python35/root/usr/bin/python3.5. You can use this path to get the version again (just to verify that this path is working for you.)
Awesome, now please exit out of the current shell of scl.
Now, lets get the version again through this complete python3.5 path /opt/rh/rh-python35/root/usr/bin/python3.5 --version.
It won't give you the version but an error. In my case, it was
/opt/rh/rh-python35/root/usr/bin/python3.5: error while loading shared libraries: libpython3.5m.so.rh-python35-1.0: cannot open shared object file: No such file or directory
As mentioned in Tamas' answer, we gotta find that so file. locate doesn't work in shared hosting and you can't install that too.
Use the following command to find where that file is located:
find /opt/rh/rh-python35 -name "libpython3.5m.so.rh-python35-1.0"
Above command would print the complete path (second line) of the file once located. In my case, output was
find: `/opt/rh/rh-python35/root/root': Permission denied
/opt/rh/rh-python35/root/usr/lib64/libpython3.5m.so.rh-python35-1.0
Here is the complete command for the python3.5 to work in such shared hosting which would give the version,
LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64 /opt/rh/rh-python35/root/usr/bin/python3.5 --version
Finally, for shorthand, append the following alias in your ~/.bashrc
alias python351='LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64 /opt/rh/rh-python35/root/usr/bin/python3.5'
For verification, reload the .bashrc by source ~/.bashrc and execute python351 --version.
Well, there you go, now whenever you login again, you have got python351 to welcome you.
This is not just limited to python3.5, but can be helpful in case of other scl installed softwares.

Meteor command not found

I installed the same version from Official Windows Meteor Support on one computer and the command "meteor" runs normally, now I tried to install in another computer but is giving me the issue that the "meteor command was not found". I tried to add the path to the system variables, but it doesn't seem to work.
Any ideas? Thank you
I have just discovered in Windows (I am using Windows 8.1) that you have to type meteor.bat to invoke meteor. e.g. meteor.bat create myapp
The answers already listed were only half the answer for me.
The following steps, resolved the issue.
Set the SYSTEM Environment Variable to:
C:\Users\%username%\AppData\Local\.meteor
Or if you prefer, change to your username explicitly
C:\Users\rich\AppData\Local\.meteor
Then as per the accepted answer on this question.
Create a file named meteor in the directory where the meteor.bat is. E.g. the path above.
Hint, you can use
touch meteor
Copy these lines into the file and save
#!/bin/sh
cmd //c "$0.bat" "$#"
For others that might come across this issue.
I'm on Windows 10 and installed Meteor 1.4. Was getting meteor command not found when trying to run meteor from command prompt.
I checked my users PATH variables and found this entry:
C:\Users\%username%\AppData\Local\.meteor\
I removed the last backslash, saved the PATH variables, and then opened a new command prompt. The meteor command was now recognized.
My PATH variable entry now looks like this with the last backslash removed:
C:\Users\%username%\AppData\Local\.meteor
Note: You can replace %username% with your actual windows username. The entry should work fine as the system will resolve it to your username.
If path variable is not present in environment variables,
You can execute the command only from the directory where meteor is present. i.e., "C:\Users\username\AppData\Local.meteor\" directory.
To use the meteor from any directory inside the command prompt,
Add path variable to the environment settings.
"C:\Users\username\AppData\Local.meteor\meteor.bat".
Restart command prompt if already open.
This will enable meteor command to work everywhere.
The question is old but it might help others who face similar issue.
I just installed meteor and had the same issue. It looks like it installed successfully and added C:\Users\USERNAME\AppData\Local.meteor to the User variable (not system variable).
I am using Windows 10 and I might have to re-login or reboot for that to start working properly.
So, to use without re-login or reboot, use complete path in the directory where you want to create the project:
C:\Projects> C:\Users\USERNAME\AppData\Local.meteor\meteor my_project
Hope it helps.
Using the Node Command prompt instead of Terminal worked for me. Search for Node Command Prompt in the Start Menu.
On Linux,
If the problem comes from systemd service (systemclt) configuration, the PATH is not recognized properly, then:
Here is the error log:
Feb 3 00:13:43 localhost metassa-org[65870]: > meteor run --port=9999
Feb 3 00:13:43 localhost metassa-org[65881]: sh: 1: meteor: not found
Feb 3 00:13:43 localhost metassa-org[65870]: npm ERR! code 127
Feb 3 00:13:43 localhost metassa-org[65870]: npm ERR! path /var/www/domain.org/meteor/simple-todos-react
Feb 3 00:13:43 localhost metassa-org[65870]: npm ERR! command failed
Edit your service configuration file:
Environment="PATH=/home/ubuntu/.npm-global/bin:/home/ubuntu/.meteor:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$PATH"
Replace /home/ubuntu with your user folder containing meteor install.
You may replace all with your current $PATH value instead.
ExecStart=/usr/bin/npm run start --prefix /var/www/meteor/simple-todos-react
Modify /var/www/meteor/simple-todos-react with your meteor project
Finally, restart your service.
sudo systemctl daemon-reload

Setting Version of iOS simulator from Command line

Context: Running automated scripts using Xcode's UIAutomation with simulators 6.1 and 5.1
Xcode version is 4.6.1
Problem: When running a shell script from the Terminal, UIAutomation ALWAYS opens up 6.1, even though i've set the app path to 5.1.
I've tried building and running on 5.1, also if i run the test from Instruments, I'm able to choose the target for 5.1 and it works fine. The problem is only when i run it from the command line.
I checked the iphonesimulator.plist and the currentSDKRoot points to the 5.1 path, but as soon as the shell script runs, it changes to 6.1. Is there anyway I can force it to use 5.1?
After hours of searching (including the most apt one - Launch a specific Hardware version of iOS simulator using instruments command line utility) , there seems to be no solution to this.
There is a way to set the device using defaults write com.apple.iphonesimulator \ "SimulateDevice" '"iPad"'
I need something like defaults write com.apple.iphonesimulator \ "Version" '"5.1"'
though obviously that doesn't work.
Any pointers will be much appreciated. Thank You!
EDIT: I was hoping this would be resolved with XCode 5, but I still have the same issue and iOS7 simulator ALWAYS opens up! Btw,is there a way to circumvent this issue - I'm sure there are many out there running multiple simulator versions.
This isn't elegant, but it is a work around that we have been able to get to work on our automation setup:
Install Xcode 5 from the App Store
Install Xcode 4.6.3 or from the developer portal's "Old Versions of Xcode page"
Repeat with older versions of Xcode where the max sim version == the one you want to run
Use "sudo xcode-select -switch /path/to/Xcode.app" to pick the version of Xcode
Hope that helps!
I also ran into this issue while running my automation tests on my Jenkins box and I did the following to test my app with ver 6.1 simulator and not 7.0 simulator:
Using Jenkins:
STEP 1 = I create one job that builds my ios app with the 6.1 sdk version.
===========================================
STEP 2 = I create a 2nd job using a bash script that downstreams from the 1st job which does the following:
[Go inside the Xcode app location to get to the iphone simulator sdk directory]
cd '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/'
[Move the 'iPhoneSimulator7.0.sdk' directory to another location (I chose the desktop)]
echo [ENTER ADMIN PASSWORD HERE] | sudo -S mv iPhoneSimulator7.0.sdk/ ${HOME}/Desktop
[Rename the 'iPhoneSimulator6.1.sdk' to 'iPhoneSimulator7.0.sdk']
echo [ENTER ADMIN PASSWORD HERE] | sudo -S mv iPhoneSimulator6.1.sdk/ iPhoneSimulator7.0.sdk/
===========================================
STEP 3 = I create 3rd job that executes my tests. The 3rd job downstreams from my 2nd job.
===========================================
STEP 4 = I create a 4th job that downstreams from the 3rd job. The 4th job uses a bash script which does the following:
[Go inside the Xcode app location to get to the iphone simulator sdk directory]
cd '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/'
[Rename the 'iPhoneSimulator7.0.sdk' back to 'iPhoneSimulator6.1.sdk']
echo [ENTER ADMIN PASSWORD HERE] | sudo -S mv iPhoneSimulator7.0.sdk/ iPhoneSimulator6.1.sdk/
[Go to directory where you moved the 'iPhoneSimulator7.0.sdk' (in my case I moved the 'iPhoneSimulator7.0.sdk' to the desktop)]
cd ${HOME}/Desktop
[Move the 'iPhoneSimulator7.0.sdk' directory back to the Xcode app sdk directory]
echo [ENTER ADMIN PASSWORD HERE] | sudo -S mv iPhoneSimulator7.0.sdk/ '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/'
[I kill any lingering processes related to the automation]
ps ax|grep [b]ash|awk '{print $1}'|xargs kill -9
ps ax|grep [i]nstruments|awk '{print $1}'|xargs kill -9
===========================================
I probably need to make this process more foolproof however I think its better than having multiple instances of xcode on the automation machine.

Resources