• Home
  • Blogger
  • Github
  • Travel
  • The Tank Project
skip to main | skip to sidebar

Steven Occhipinti

A braindump.

Git + Hub = GitHub

As mentioned in a previous post, we use GitHub-Flow at work and I really like it.
In essence, it involves doing work in feature branches, while maintaining an always deployable master branch, then opening a pull request to merge a new feature / bugfix into master, which provides a great mechanism for code review / sign-off.

So a fairly typical situation would be as follows:
  • Bug found in app
  • Create an issue on GitHub with description, assignee, etc.
  • Create a new branch off master for the fix
  • Code it up, test locally, etc.
  • Push branch to GitHub
  • Open pull request to merge back into master
  • Get review / sign-off inside of the pull request
  • Deploy
When a pull request is opened on GitHub, it automatically creates an issue for that pull request, which would normally be helpful, but we already created an issue when the bug was discovered.
So now we have 2 issues and 1 pull request. What's nice is that if I push more commits to that branch, it will appear in the pull request automatically, but not the initial issue.

After looking into this, it seems (AFAIK) GitHub do not provide a way of attaching a pull request to an existing issue via the site, but they do provide that functionality via their API.

That is when I discovered Hub.
Hub is a wrapper for git and while it adds more power to alot of the standard git commands, hub adds one command that is really useful for me:

git pull-request -i 49

This basically means "Open a pull request to merge the current branch into master and attach the pull request to issue 49".

This means that the initial bug description, the commits, the review conversation and the merge are all encapsulated in a single issue - fantastic!
I don't know why this isn't built in to the web interface (or maybe it is and I just don't know how).
Posted by Steve at 13:37 0 comments
Labels: git , github Email This BlogThis! Share to X Share to Facebook

Copy and Paste over SSH with Xclip

Have you ever SSH'ed to a server and found you need to copy some data back where a simple selection copy and paste just doesn't seem practical?
When this happens to me, I normally dump that data to a temp file, start up another terminal and SCP the file back before going back to delete the temp file, but I recently found a better way.

I discovered xclip. Using the -X option of SSH to enable X11 forwarding, xclip allows you to interact with the "X selections" clipboard.

To use it, log on to a remote server via ssh -X and ensure xclip is installed, then simply pipe data to xclip and you will be able to paste it anywhere locally with the usual X selection paste (mouse wheel click, shift-insert, etc.).

Here is an example:

ssh -X steve@example.com
sudo apt-get install xclip
ps -ef | xclip

Now anywhere on your local linux machine, you can press <shift>-<insert> (or mouse wheel click) to paste the content.
If you need to pipe this data to another process locally, you can retrieve the clipboard from the command like with xclip like this:

xclip -o | less
Posted by Steve at 23:59 0 comments
Labels: linux , xclip Email This BlogThis! Share to X Share to Facebook

Minecraft exception in linux


I finally decided to install Minecraft on my new shiny Toshiba Portege z830.
Ubuntu ships with an open-source version of Java, which did run Minecraft, but the graphics were terrible, even on the lowest settings. There were artefacts everywhere!

So as recommended, I switched to the official JRE, but now the login screen works, but that's about it. After logging in, I just got a black screen and the following exception in the console:


Exception in thread "Minecraft main thread" java.lang.ExceptionInInitializerError at net.minecraft.client.Minecraft.a(SourceFile:180) at net.minecraft.client.Minecraft.run(SourceFile:648) at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at org.lwjgl.opengl.XRandR$Screen.<init>(XRandR.java:234) at org.lwjgl.opengl.XRandR$Screen.<init>(XRandR.java:196) at org.lwjgl.opengl.XRandR.populate(XRandR.java:87) at org.lwjgl.opengl.XRandR.access$100(XRandR.java:52)at org.lwjgl.opengl.XRandR$1.run(XRandR.java:110) at java.security.AccessController.doPrivileged(Native Method) at org.lwjgl.opengl.XRandR.getConfiguration(XRandR.java:108) at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:618) at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
... 3 more

After discussing the problem in IRC, the solution was quite simple. It turns out "lwjgl" is a "Light Weight Java Game Library" and the version I had wasn't behaving.
On the advice of the helpful IRC'ers, I downloaded the latest "lwjgl" from here (which at time of writing is 2.8.3) to get it all to work nicely.

To install it, I downloaded the zip file, extracted it to a temporary directory, then copied across these files:
cp lwjgl-2.8.3/jar/lwjgl.jar ~/.minecraft/bin
cp lwjgl-2.8.3/native/linux/* ~/.minecraft/bin/natives
Done! Now it works nicely.
Posted by Steve at 23:25 20 comments
Labels: java , linux , minecraft , ubuntu Email This BlogThis! Share to X Share to Facebook
Newer Posts Older Posts Home

Blog Archive

  • ►  2013 (4)
    • ►  June (1)
    • ►  May (1)
    • ►  March (1)
    • ►  January (1)
  • ▼  2012 (17)
    • ►  December (1)
    • ►  October (1)
    • ►  September (2)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  April (2)
    • ►  March (3)
    • ▼  February (3)
      • Git + Hub = GitHub
      • Copy and Paste over SSH with Xclip
      • Minecraft exception in linux
  • ►  2011 (33)
    • ►  December (1)
    • ►  November (3)
    • ►  October (3)
    • ►  September (4)
    • ►  August (3)
    • ►  July (4)
    • ►  June (6)
    • ►  May (6)
    • ►  April (3)

Labels

android (5) apache (1) arch linux (1) arduino (1) bash (11) calendar (1) compiz (1) design (1) diff (1) email (1) gimp (1) git (3) github (2) gnome3 (1) Google (2) hacking (1) hardware (4) howto (1) htpc (1) java (1) lamp (1) linux (28) Mac (2) minecraft (2) mysql (1) netduino (1) nfs (1) parallel port (1) patch (1) photography (4) php (1) pidgin (2) printer (1) programming (6) python (1) rails (1) regex (5) review (3) ruby (3) Samsung Galaxy S3 (2) Samsung Series 9 (1) security (1) sed (3) ssh (1) sudo (1) tank (2) Toshiba Portege (1) troubleshooting (1) ubuntu (16) ui (2) unity (2) vim (5) webcam (1) websites (3) xbmc (1) xclip (1) xul (1)

Total Pageviews

Sparkline
 
Copyright (c) 2010 Steven Occhipinti. Designed by Conveyancing
High Deductible Health Insurance, Purchase Beats