How to split Git repositories into two
Ever wondered how to split your Git repo into two repos?
First you need to find out what files and directories you want to move to separate repos. In the above example we’re moving dir3, dir4, and dir7 to repo A, and dir1, dir2, dir5, and dir8 to repo B.
Steps
What you need to do is to go through each and every commit in git history for every branch and filter out commits that modify directories that you dont care about in your new repo. The only flaw of this method is that it will leave those empty, filtered out commits in the history.
Track all branches
First we need to start tracking all branches locally:
for i in $(git branch -r | grep -vE "HEAD|master" | sed 's/^[ ]\+//');
do git checkout --track $i
doneThen copy your original repo to two separate dirs: repo_a and repo_b.
cp -a source_repo repo_a
cp -a source_repo repo_bFilter the history
Following command will delete all dirs that exclusively belong to repo B, thus we create repo A. Filtering is not limited to directories. You can provide relative paths to files, dirs etc.
cd repo_a
git filter-branch --index-filter 'git rm --cached -r dir8 dir2 || true' -- --all
cd repo_b
git filter-branch …git
How to check process duration in Linux with the “ps” command
In certain cases we might want to get a certain process’ elapsed time for our own reason. Turns out “ps” command could easily assist us in that. According to “ps” manual, etime could put the duration of time in [[DD-]hh:]mm:ss. format, while etimes in seconds.
From “ps” manpage:
etime ELAPSED elapsed time since the process was started, in the form [[DD-]hh:]mm:ss.
etimes ELAPSED elapsed time since the process was started, in seconds.To use that, we could use (in [[DD-]hh:]mm:ss. format):
ps -p "pid" -o etimeor in seconds:
ps -p "pid" -o etimesIn this case the “pid” should be replaced with your intended process ID.
The following will help to nicely reporting the output. We can put -o etime or -o etimes with other argument, that is “command”, in order to show the executed command along with its very own absolute path:
ps -p "28590" -o etime,commandELAPSED COMMAND
21:45 /usr/bin/perl ./fastcgi-wrapper.pl 7999We can also get the start date of the process’ execution:
najmi@ubuntu-ampang:~$ ps -p 21745 -o etime,command,start
ELAPSED COMMAND STARTED
1-19:47:45 /usr/lib/firefox/firefox Aug 02What if we do not …
shell linux
JBoss 4/5/6 to Wildfly migration tips
Introduction
Recently, we have taken over a big Java project that ran on the old JBoss 4 stack. As we know how dangerous for a business is outdated software, we and our client agreed that the most important task is to upgrade the server stack to the latest WildFly version.
It’s definitely not an easy job, but it’s worth to invest to sleep well and don’t worry about software problems.
This time it was even more work because of a complicated and not documented application, that’s why I wanted to share some tips and problem resolutions for issues I encountered.
Server configuration
You can set it up using multiple configuration files in the standalone/configuration directory.
I can recommend to use the standalone-full.xml file for most of setup, it contains a default full stack as opposed to standalone.xml.
You can also set up an application specific configuration using various configuration XML files (https://docs.jboss.org/author/display/WFLY10/Deployment+Descriptors+used+In+WildFly). Remember to keep the application specific configuration in the Classpath.
Quartz as a message queue
The Quartz library was used as a native message queue in previous JBoss versions. If you struggle …
java
co:collective Doable Innovation Software
co:collective is a growth accelerator that works with leadership teams to conceive and execute innovation in the customer experience using a proprietary methodology called StoryDoing.
Doable, one of co:collective’s recent innovations, is a cloud-based platform designed to empower employees to meaningfully contribute and collaborate on ideas that move their business forward. The tool allows companies to solicit ideas from employees at all levels of an organization, filter down those ideas, make decisions as a team, and then implement a project—all the while collaborating in a fun and easy-to-use application. Over 200 companies across multiple sectors use Doable to create new products, new features, and problem solve to keep their business growing.
co:collective engaged End Point’s front-end developer Kamil Ciemniewski to work with their in-house development team led by Tommy Dunn. Kamil joined the Doable effort to refactor the Doable application which was moving from a classic Ruby on Rails-based application to an Angular frontend application with a Ruby on Rails backend. Kamil has been working with Doable since March to complete the application re-write and the project has gone …
case-study clients
Postgres migrating SQL_ASCII to UTF-8 with fix_latin
Upgrading Postgres is not quite as painful as it used to be, thanks primarily to the pg_upgrade program, but there are times when it simply cannot be used. We recently had an existing End Point client come to us requesting help upgrading from their current Postgres database (version 9.2) to the latest version (9.6—but soon to be 10). They also wanted to finally move away from their SQL_ASCII encoding to UTF-8. As this meant that pg_upgrade could not be used, we also took the opportunity to enable checksums as well (this change cannot be done via pg_upgrade). Finally, they were moving their database server to new hardware. There were many lessons learned and bumps along the way for this migration, but for this post I’d like to focus on one of the most vexing problems, the database encoding.
When a Postgres database is created, it is set to a specific encoding. The most common one (and the default) is “UTF8”. This covers 99% of all user’s needs. The second most common one is the poorly-named “SQL_ASCII” encoding, which should be named “DANGER_DO_NOT_USE_THIS_ENCODING”, because it causes nothing but trouble. The SQL_ASCII encoding …
postgres unicode perl
Liquid Galaxy at 2017 BOMA International Annual Conference & Expo
We just returned from Nashville after bringing Liquid Galaxy to the 2017 BOMA International Annual Conference & Expo. Commercial real estate has always been a seamless fit for Liquid Galaxy due to the system’s ability to showcase real estate and property data in an interactive and panoramic setting. Within real estate, Liquid Galaxy was first used by CBRE and has since been adopted by Hilton, JLL, and Prologis to name a few.
In preparation for BOMA (Building Owners and Managers Association), we prepared sample commercial real estate content on our content management system to be displayed on the Liquid Galaxy. This included the creation of content about Hudson Yards, the new development being built in lower Manhattan.
The content that was created demonstrates how brokers and directors at commercial real estate companies can tell an immersive, panoramic, and interactive story to their potential clients and investors. Future developments can be shown in developing areas, and with the content management system you can create stories that include videos, images, and 3D models of these future developments. The following video demonstrates this well:
We were able to effectively …
cesium conference visionport graphics unity event
Zero Pricing in Interchange using CommonAdjust
Product pricing can be quite complex. A typical Interchange catalog will have at least one table in the ProductFiles directive (often products plus either options or variants) and those tables will often have one or more pricing fields (usually price and sales_price). But usually a single, static price isn’t sufficient for more complex needs, such as accessory adjustments, quantity pricing, product grouping–not to mention promotions, sales, or other conditional features that may change a product’s price for a given situation, dependent on the user’s account or session.
Typically to handle these variety of pricing possibilities, a catalog developer will implement a CommonAdjust algorithm. CommonAdjust can accommodate all the above pricing adjustments and more, and is a powerful tool (yet can become quite arcane when reaching deeper complexity). CommonAdjust is enabled by setting the PriceField directive to a non-existent field value in the tables specified in ProductFiles.
To give an adequate introduction and treatise on CommonAdjust would be at a minimum its own post, and likely a series. There are many elements that make up a CommonAdjust string, and subtle operator nuances …
ecommerce interchange
Liquid Galaxy at The Ocean Conference
End Point had the privilege of participating in The Ocean Conference at the United Nations, hosted by the International Union for Conservation of Nature (IUCN), these past two weeks. The health of the oceans is critical, and The Ocean Conference, the first United Nations conference on this issue, presents a unique and invaluable opportunity for the world to reverse the precipitous decline of the health of the oceans and seas with concrete solutions.
A Liquid Galaxy was set up in a prominent area on the main floor of the United Nations. End Point created custom content for the Ocean Conference, using the Liquid Galaxy’s Content Management System. Visiting diplomats and government officials were able to experience this content—Liquid Galaxy’s interactive panoramic setup allows visitors to feel immersed in the different locations, with video and information spanning their periphery.
Liquid Galaxy content created for The Ocean Conference included:
- A study of the Catlin Seaview Survey and how the world’s coral reefs are changing
- 360 panoramic underwater videos
- All Mission Blue Ocean Hope Spots
- A guided tour of the Monaco Explorations 3 Year Expedition
- National Marine Sanctuaries …
conference event visionport




