I’m currently helping Proposales to develop their platform and a while back I posted a guest post over at their blog. It’s about Knex migration, Bookshelf ORM, PostgreSQL and Boolean.
How do you reset a Git repository to a certain commit? This example will delete the commits made after the commit you want to reset to, and then we’ll push it to origin.
This is what my latest commit looks like on a testrepo, but lets say I want the
signs? commit to be the latest commit.
Make sure you are on the branch where the commit is. I’m doing this on master.
Then use git reset –hard <commit-hash> to set the current branch HEAD to the commit you want.
When we push the change to origin when need to use force
This is how the commits looks on my testrepo origin now:
Background and source
A colleague asked me how to set the HEAD of a branch to an older commit. I thought of using revert. But that would save the changes in a revert-commit, which was not desired this time. So I didn’t know how. My colleague found a stack overflow thread containing the answer that we tried and was successful with.
Screenbar is an application that takes screenshots for you when you need your hands to do something else, like playing a game. It has now been released on the Mac App store. It was also shipped with a new design.
Download and install
You can download and install it from the Mac app store
The new stuff
This version comes with two changes. It is sandboxed and has a new design.
This version is Sandboxed.
App Sandbox is an access control technology provided in macOS, enforced at the kernel level. It is designed to contain damage to the system and the user’s data if an app becomes compromised. - Apple
This means the screenshots will be saved in the users Picture folder. The folder name needs to be called com.honkbarkstudios.screenbar.
The design changed to use a dark theme. Other devs might recognize it as vibrantDark. The two menus are also merged into one.
On a project I’m working on there is an integration to the payment provider Klarna. I was having trouble to get it to work on my local development environment.
Everytime a purchase was made the visitor(me) was supposed to get redirected back to the dev-environment. I was… but to the wrong url: https://local-dev-env-url/+CSCOE+/wrong_url.html In my case this was connected to the
What is the validation_uri ?
“This checkout function will allow you to validate the information provided by the consumer in the Klarna Checkout iframe before the purchase is completed.”
You can read more about it and the use cases in the Klarna documentation
This is an example of what is sent to Klarna in my local environment, and you can see the validation_uri at the bottom.
Since I’m running this code locally the Klarna API can’t reach my validation uri. That was what was causing my problem. For debugging purposes you can skip to send the validation_uri since it is an optional setting according to the documentation. To also debug the validation logic you need to make sure the Klarna API can reach that url.
Hopefully this helps someone else in the same situation as I was. But I have a feeling you can encounter the same error but it’s being caused by something else.
A big thanks to the Klarna support for helping out with this!
1. Installing Dislocker and FUSE for macOS
Enter the following commands in a terminal:
When I ran the last command to install dislocker this error showed up:
By unlinking ruby as explained by jricks92 on Github the install went through with no errors:
2. Drive identifier
Now we need to know the identifier of the bitlocker encrypted disk. In the terminal we’ll run the command
diskutil list (on macOS).
The identifier i’m interested in here is called disk2s1
3. Encrypt with dislocker
First we need to create a folder where a virtual NTFS partition called dislocker-file will be created. I’ll call mine externalhdd and i’ll create it in the mnt folder.
Now it’s time to use Dislocker to decrypt the disk.
-V /dev/disk2s1 tells dislocker what disk to decrypt.
-u tells dislockers to ask the user for the password the disk is encrypted with.
-- /mnt/externalhdd passes the path to the folder we created to store the virtual ntfs-partition.
4. Create a block device
Now we need to create a block device before mounting the disk.
hdiutil - manipulate disk images (attach, verify, create, etc)
attach - Attach a disk image as a device
imagekey - specify a key/value pair for the disk image recognition system. I can’t find information on what the diskimageclass=creatdiskimage means in the man pages of hdiutil.
nomount - indicate whether filesystems in the image should be mounted or not.
After running this command i got the line /dev/disk3 printed in the console. Now we’ll use that to mount the drive.
Start by creating a folder where the drive will be mounted
Then we run this command to mount it (only readable):
And by now, if you haven’t encountered any errors, you should see the disk in Finder.
There are more to dislocker than this post shows, take a look at the man pages to get more info: