Sai Ram's Blog

thoughts, ramblings and ideas of a geek

Making a better and powerful API based PasteBin

Update: Code is present at github/sairam/daata-portal

The product is aimed as a tool for developers so that they can store arbitrary information like partial extracts from logs or log files like an s3, but hosted internally which need not scale. The aim is to provide a tool where the complete company can share data as well as information.

Running commands on all machines is the standard thing, but capturing the output and cleaning that up is usually a matter of making scripts to clean up the data especially when you are debugging during downtime of your service.

I have talked to 10 of my developer/devops friends some of whom liked and appreciated the usecase while some others were motivated to write a tool for their specific need and maintaining it.

My idea of the API looks like a regular pastebin with apps. The tool should be hosted with authentication or within a company ecosystem.

Code Name: daata

daata is the simplest name I came up with signifying data and has a .xyz domain too

Some of the features that are currently present:

  • Upload static files
    • Host text files
    • Host flame graphs from your code
  • Upload a zip file to extract the files
    • This is ideal during the phase of a build to host your documentation
    • Host website HTML mocks from designers
    • Host static websites/pages/single page apps
  • bitly like Redirection of urls useful when sharing links or urls with teams
  • track simple metrics with time/key/value into a graph providing insights

Update: Code is open source and present at github/sairam/daata-portal

Future plans:

  • Proxying/Mocking HTTP requests
    • Catch and respond to http requests in local/staging systems like SMS/Email
    • Mock requests in local environments from production data
    • Proxy requests through the service to capture/debug information
    • Replay requests from caught requests to one or more services
  • Features like ngrok to proxy local connections to a central setup
  • Display logfile stats like Kibana to display information
  • Pluggable modules that can be linked
  • Sharing files within the network/intranet (p2p sharing)

Started the analysis in early September 2016 and coding started on Sep 15 2016, it went a bit slow since I am new to the language and the other languages that I have worked on continue to influence me on how to do.

P.S. do not take time finding good names for your projects, you can change them later anyways. I have spent more brain cycles trying to find a name than code it up or market it


Screen Capture Command on Mac

(This article was intended to be written on 18th Sep 2016, but actually written on 8th April 2017)

In order to take a screenshot on Mac, the standard way is to the Grab application.

Keyboard users often get used to these.

⌘ + ⇧ + 3  - full screen which generated a file on Desktop
⌘ + ⇧ + 4 - capture custom dimensions using the mouse.

I recently discovered that screencapture command is part of the OS X. I happen to have the need to paste a screenshot in a chat (in the current world, input boxes or gmail compose allows you to paste an image inline without the need to have a file on disk)

screencapture -c -i

solves most of my needs to capture interactively with output into the clipboard.


TIL: Bash History CLI Shortcuts

## Previous Command's All Arguments
mkdir long_path_here/new_dir
cd !*

## Previous Command's Last Argument
mkdir long_path_here/new_dir
cd !$

or even use $_ instead of !$

## Previous Command's First Argument
mkdir long_path_here/new_dir
cd !^
## History
mkdir long_path_here/new_dir
cd `Esc` `.`
cd `Alt`+`.`

Pressing Esc followed by . will give previous arguments

## "More Options"

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments

Getting Alt to run on iTerm

  • Open Preferences in iTerm using Command+,
  • Go to Profiles
  • Go to Keys
  • Fix the setting Left option key acts as

    iTerm Preferences - How to Change Alt as Meta key

If you are Terminal on Mac, consider moving to iTerm(if you are not a power user)

  • If you still want this setting in Terminal, look here

Sources


Bye bye Delicious! Yo Pinboard!

Delicious has been one of my favourite and a tool that I have held since 200[78]. The entity has been through several transitions. People have feared and moved out and became in-active. del.icio.us the most famous domain hack around 2008. Yahoo bought it, later sold it and I don’t know what happened later on.

Then, starting around Dec 2015, Delicious started popping up Advertisements. They were like the ads from 2000s where you see amazing animations which sucked. Improvising to it, in March 2016, they decided to move from https to http which blew my mind away (not literally).

Time to evaluate choices

What I really want? (aka The Product Spec)

What I really wanted was a place where I can maintain a public list and query bookmarks by tag for later references.

Both services (Pocket and Pinboard) offer you a way to search through the text itself for the higher versions of the service. You can achieve that with the help of Evernote. Evernote has that capability as well. Google and Chrome Bookmarks sync through devices and follow you, but they lack the UX feel I have been used to(like Delicious). Pocket felt overwhelmingly because of the UI. Its a 2015 UI product, while Pinboard UI continued to stay in the 2010s with the light-weight and simple(way too simple) UI.

I realized that Evernote gives this and way more, but I made the hard choice of keeping Evernote to referencing data from sites instead of actually bookmarking them. Evernote does a lot of things(A LOT).

The DECISION - Pinboard

Pinboard has a yearly $11 pricing for the basic version and been in service more than others. I might move to Pocket later only for the UI, even if it means $45 for the Pro version Also, Pinboard does not bug me with weekly newsletters like Pocket does 😃

Pinboard has the social angle of tagging “for:user” which Delicious killed off just after the Yahoo acquisition(to my knowledge) or after the news Yahoo was buying Delicious. My social circle who were in Delicious immediately reached ZER0.

Follow and suggest me links https://pinboard.in/u:sairam/

The bookmarklet which I can invoke through the keystrokes on chrome helps a lot. yd which invoke the bookmark to open a new window to prompt to add tags.

I am yet to explore notes in Pinboard


Clash of Clans — Yet Another Addiction

My requirement came from my awesome Clash Of Clans (wiki) by SuperCell addiction I have developed starting since August 15th 2015. (The day was celebrated as Indian Independence day. What more glorious day to start a war game 😉 )

Why?

I felt I was missing mobile gaming fun in my life. I chose this since there are colleagues who are already playing.

What I liked about the game

My colleagues have tutored me about the game, strategies, what to do, what not to do. I have been happy that I started learning and applying strategies to a game. I can’t thank them enough for teaching me.

Summary about the game

The gamification done by SuperCell is amazing. You need to collect resources, spend them on upgrades, work with your clan to attack other clans in an organized fashion called clan war.

I started recording war videos

Record video via mac  — iDevice (iPod/iPad) allow you to record everything that is happening on it.

Clash of Clans is too big an addiction.

P.S. If you cannot see your iDevice, try reset the warnings in iTunes . Some even tried a fresh install of a Mac, but this worked fine for me.

Update (Late February 2016): About mid February 2016, I stopped opening the game as much I should have. I think I have cured my addiction of CoC by getting addicted to Clash Royale kind of migrated by addiction.

Update (mid March): I got better and stopped opening both the apps and got better organized