Git-Tower for Mac - how can i use --no-verify flag in each commit? - git-tower

We are using husky pre-commit hooks and i cannot commit with tower ever since. I use the CLI for my commits now but i want to be able to use Git Tower as well.
Any users out there know a quick fix? Thank you.

To disable hooks introduced by husky in frontend project, you can:
Create environment.plist file in ~/Library/Application Support/com.fournova.Tower3/ with following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HUSKY_SKIP_HOOKS</key>
<integer>1</integer>
</dict>
</plist>
That's it. Next time if you try to push something, hooks introduced by husky will be disabled.
Note: you can also use this flag with CLI like this:
HUSKY_SKIP_HOOKS=1 git <command> ...
I've also wrote a blog post about it.

In general, Desktop Apps don't have the Shell environment available.
In order to enable you to use your commit hook with the bundled Git binary, you'll need to set up an environment.plist file manually.
Here is a detailed guide for this in the Tower Help guide: https://www.git-tower.com/help/mac/faq-and-tips/faq/hook-scripts
Please feel free to reach out to us via https://www.git-tower.com/support/contact if you need further assistance.

I have found this useful article: https://dev.to/studiospindle/using-husky-s-pre-commit-hook-with-a-gui-21ch
You can create a file ~/.huskyrc containing:
PATH="/usr/local/bin:$PATH"
or if you use nvm:
PATH="/usr/local/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

Related

Apple Hypervisor is completely broken on MacOS Big Sur beta 11.0.1

I am trying to make a basic command-line tool that makes a VM and runs something using Apple Hypervisor.
When I try to run hv_vm_create(HV_VM_DEFAULT) it gives me an error code -85377023.
I tried enforcing App Sandbox and setting the entitlement accordingly for the Big Sur compile target, and now I am getting this output in the console:
Killed
From what I understand from this, this is AMFI killing my process. Is this a bug or my problem?
When I decided to go down the rabbit hole, I found that in the MacOS Big Sur 11.0.1 beta release notes, they deprecated hv_vm_run(_:), while the API documentation says that this function is in beta.
I didn't go as far as disabling AMFI with a kernel flag, but I am almost certain that this is not expected behavior. And that, no matter what, hv_vm_run(_:) can never be deprecated OR be in beta. I am sure that this function existed well before Big Sur.
If anyone can help me with this or just give a response, please do. Do not keep me in darkness as I don't want to waste time on something which is potentially broken.
Thank you.
P.S: I know that there is already a thread in the Apple Developer forums, I am the one who posted it. Though, no one is answering there because their community is not even close to being as large as Stack Overflow.
This error code you're seeing is just a poor UX on the macOS side: what it's really trying to communicate is that the com.apple.security.hypervisor entitlement is missing.
If you're using Xcode, you can add it like that:
Press ⌘N and create a new Property List file.
Add a new property with the key com.apple.security.hypervisor and a boolean value set to YES.
Go to Project → Target → Build Settings → Signing → Code Signing Entitlements and make sure it uses your newly created entitlements file.
Alternatively, you can use command line:
codesign -s - --entitlements app.entitlements --force path/to/your/binary
Where app.entitlements contents is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.hypervisor</key>
<true/>
</dict>
</plist>
The other way you to solve this is to simply set the Deployment Target to 10.13 in the Xcode's settings (props to Alexander Pinske):
The reason this works is most likely due to backwards-compatibility, so bear in mind that this might change in the future macOS releases, or, perhaps, on newly introduced platforms like Apple Silicon.

How to install solr-4.6.1 on ubuntu using tomcat7?

I want step by step instructions for installation of solr search engine using tomcat7 on ubuntu. I searched on google but I am not getting proper reference. Please help me to install it.
1- Download Solr dist: here. Unzip it anywhere.
2- find $EXTRACTEDDIR/solr/dist/solr-4.6.1.war and copy it to the location you want to configure solr.
3- configure the solr.xml as explained here. You will need to change your hostport to 8080(or what ever port tomcat7 is configured) and put it where you put solr-4.6.1.war
4- create /etc/tomcat7/Catalina/localhost/solr.xml and put
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="$SOLRBASE/solr-4.6.1.war" debug="0" privileged="true" allowLinking="true" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="$SOLRBASE" override="true" />
</Context>
replace SOLRBASE with the loacation you put solr.war and solr.xml.
5- copy $EXTRACTEDDIR/example/lib/ext/* . * to /usr/share/tomcat7/lib(for loging libs)
6- give permissions of the folder where you put solr.war and solr.xml to "tomcat7" user.
7- restart tomcat and you are done.
copy the solr files to ubuntu.
copy the file "solr.war" into "%tomcat_home%/webapps/" and add the solr service's context to the "%tomcat_home%/server.xml"
set the environment value "solr/home" int server.xml or web.xml
visit here for detail:https://wiki.apache.org/solr/SolrTomcat
it's a piece of cake, may you succeed!

Guestbook app deployment error cloud SQL

app engine log says
java.sql.SQLException: No suitable driver found for jdbc:mysql://173.194.111.127:3306/Guestbook
Help says make sure appengine-web.xml includes true which is the last line before in my file. I could use some help getting this connection to work.
A couple of things that you should check:
Please make sure that the MySQL JAR file is present in your WEB-INF\lib directory.
Once that is done, you can ensure that you enable the MySQL/ConnectorJ (https://developers.google.com/appengine/docs/java/cloud-sql/#enable_connector_j). As mentioned in the document, go to war\WEB-INF folder. You will find the appengine-web.xml file. Inside this file, enable the JAR file as given below:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
...
<use-google-connector-j>true</use-google-connector-j>
...
</appengine-web-app>
According to the documentation you should only be using the "jdbc:mysql" connection string for local development. For running on appengine you should use jdbc:google:mysql.

~/Library/LaunchAgents plist runs manually but not automatically

I am starting to work with launchd and want to set up a plist file such that whenever I insert an SD card into my Mac mini server (with Snow Leopard Server), I want a shell script to run (which should copy all the jpg files, rename them etc).
So, I created a plist file in the ~/Library/LaunchAgents (see below for its contents - it should be looking for changes to /Volumes) and I created a shell script which says "beep" - later it will do something more useful.
The plist file is registered with launchctl, and when I run it (launchctl start com.peters.runwhenSDmount), the computer says beep whenever a memory card is plugged in, and stays silent when there is no memory card. So, apparantly the plist does call the shell script, which subsequently checks if the specific SD card is there. I assume this also proves that there is no problem with permissions for the SD card.
But, it doesnt seem to run by itself??? Any idea why??
plist file: ~/Library/LaunchAgents/com.peters.runwhenSDmount.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<dict>
<key>Label</key>
<string>com.peters.runwhenSDmount</string>
<key>LowPriorityIO</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/Users/peter/Library/Scripts/runwhenSDmount</string>
</array>
<key>ThrottleInterval</key>
<integer>10</integer>
<key>WatchPaths</key>
<array>
<string>/Volumes</string>
</array>
</dict>
</plist>
shell script: ~/Library/Scripts/runwhenSDmount
#!/bin/bash
if [ -d "/Volumes/NIKON D40X" ]; then
say beep
fi
After you create a new plist in your ~/Library/LaunchAgents folder, you have to tell the launchd application about it. The two basic ways to do that are:
Logout then log back in. - Every time you log in, launchd will scan the contents of your ~/Library/LaunchAgents folder and add any plist it finds there.
Load the plist from a terminal command line with "launchctl". The syntax of the command is:
launchctl load {Path-to-plist}
The launchctl command can also be used to stop launchd from using a plist. To do that, use:
launchctl unload {Path-to-plist}
The launchctl command is very useful when developing plists since it makes unloading/loading them between changes quick and easy. Once you have a plist working the way you like, the automatic login launchd loading can take over.
I just had a similar problem with automatically launching the services in ~/Library/LaunchAgents, but in my case NONE of the *.plist defined services got started.
The problem was obviously connected to the directory ~/Library/LaunchAgents and not the plist files itself. The solution was to reset the file permissions.
chmod 700 ~/Library/LaunchAgents.
Update for homebrew users: (2015-02-23)
Yesterday I just found LaunchRocket which is a Mac PreferencePane for managing services with launchd. It is homebrew aware ands adds a nice UI for managing launchd homebrew services.
This may not help you with incorrect user permissions but it is open source so you can fork the project and add the permission check as a feature.
Two tools that help with the creation and management of launchd items are:
LaunchControl - "LaunchControl is a fully-featured launchd(8) frontend allowing you to create, manage and debug system- and user services on your Mac."
Lingon - "An easy to use yet powerful utility that runs things automatically on your Mac"
As a note: Brett Terpstra (who does a bunch of great Mac work on things like nvAlt) recently commented in his post "Triggering tasks remotely with notifyutil and launchd" that he used to use Lingon, but has been using LaunchControl more recently. Either of them is worth looking into.

Deploying a war to tomcat server with maven 1.1

does anyone know a way to configure a maven goal to deploy to a tomcat server after a build is run? I know that this is possible using the maven-tomcat-plugin but it looks as though as this only works for Maven 2 whereas I'm using Maven 1.1
I'm currently trying to set up Hudson so this would be part of my continuous intergration phase which I hope will run like this:
Build all necessary components
Build war and deploy to (local) server
Run selenium tests
Any help with this would be much appreciated.
Thanks.
Honestly I would refactor your project to use Maven 2, there are several guides that can help ease migration pain (google maven 2 migration), and there is even the maven-one-plugin to convert your project.xml or package your Maven 1 plugins for Maven 2.
If you can't do that, you could use the Maven 1 ant plugin to copy the war to tomcat's webapps directory after it has been packaged. Tomcat will detect the new war and should hot-deploy it.
I have to admit, I don't know much about the plugin for maven, but I do everything in a simple script that cleans the work directories as well (don't know if the maven plugin cleans the work directories).
CALL mvn clean install
CALL rm C:\apps\tomcat\webapps\Foo.war
CALL rm -rdf C:\apps\tomcat\webapps\foo
CALL rm -rdf C:\apps\tomcat\work\Catalina
CALL copy C:\webapps\workspace\Foo\target\Foo.war C:\apps\tomcat\webapps\Foo.war /y
(I know, -1 for MS scripting)
The point is you generally want to clean the work directory and the webapps directory and the Maven 1 ant plugin does not do this (as far as I know if, and read from the link provided). Tomcat is "supposed" to recreate the class files in these directories when it explodes the war file, but anybody who has worked with it long enough knows: this isn't always the case.
Therefore, if the plugin does not clean these directories, it's useless as far as I am concerned. Write yourself a cheap little script like the one provided. It takes 2 minutes.
I've figured out that best way to do this - its actually pretty easy to write a maven goal to transfer the war. The goal could be written as follows:
<goal name="deployWar" prereqs="buildWar">
<echo message="+---------------------------------------------------+" />
<echo message="installing war file to server" />
<echo message="+---------------------------------------------------+" />
<j:set var="deploy.dir" value="${server}/webapps" />
<copy file="${maven.build.dir}/${pom.artifactId}.war"
todir="${deploy.dir}" overwrite="true" />
</goal>
The server variable can be determined in your project.properties file. Also be sure to specify that a pre-requisite to build the WAR before you try to deploy it. Hope this helps someone!
webappDirectory can be configured for maven-war-plugin to deploy exploded war. Nothing special is needed, just run maven install.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webappDirectory>path/to/server/deploy/dir</webappDirectory>
</configuration>
</plugin>

Resources