Skip to content

Instantly share code, notes, and snippets.

View asheshambasta's full-sized avatar

Ashesh Ambasta asheshambasta

View GitHub Profile
Mar 15 19:37:45 pegasus kernel: PM: suspend entry (deep)
Mar 15 19:37:45 pegasus kernel: Filesystems sync: 0.010 seconds
Mar 15 19:37:47 pegasus kernel: Freezing user space processes
Mar 15 19:37:47 pegasus kernel: Freezing user space processes completed (elapsed 0.002 seconds)
Mar 15 19:37:47 pegasus kernel: OOM killer disabled.
Mar 15 19:37:47 pegasus kernel: Freezing remaining freezable tasks
Mar 15 19:37:47 pegasus kernel: Freezing remaining freezable tasks completed (elapsed 0.000 seconds)
Mar 15 19:37:47 pegasus kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Mar 15 19:37:47 pegasus kernel: serial 00:04: disabled
Mar 15 19:37:47 pegasus kernel: sd 1:0:0:0: [sdb] Synchronizing SCSI cache
# type time target_ip request_processing_time elb_status_code received_bytes sent_bytes request_url request_proto
1 h2 2022-04-05T13:10:44.130648Z 10.42.0.35 0.001 504 132 604 https://apibeta.centralapp.com:443/api/v2/distributor/companies/d-sales/leads?id=centralapp&page=0 HTTP/2.0
2 h2 2022-04-05T13:10:19.438867Z 10.42.0.35 0.001 504 239 202 https://apibeta.centralapp.com:443/api/v2/user/companies?page=0 HTTP/2.0
3 h2 2022-04-05T13:04:36.475660Z 10.42.0.35 0.001 504 131 604 https://apibeta.centralapp.com:443/api/v2/distributor/companies/d-sales/clients?id=centralapp_saas&page=0 HTTP/2.0
4 h2 2022-04-05T13:02:05.336758Z 10.42.0.35 0.001 504 109 604 https://apibeta.centralapp.com:443/api/v2/distributor/companies/d-sales/leads?id=centralapp_saas&page=0 HTTP/2.0
5 h2 2022-04-05T12:58:54.318024Z 10.42.0.35 0.001 504 86 604 https://apibeta.centralapp.com:443/api/v2/user/companies?page=0 HTTP/2.0
6 h2 2022-04-05T12:58:28.386614Z 10.42.0.35 0.005 504 81 604 https://apibeta.centralapp.com:443/api/v2/user/companies?p
@asheshambasta
asheshambasta / stack.yaml
Created August 28, 2019 06:37
composite git hashes might need to be modified.
# This file was automatically generated by 'stack init'
#
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# https://docs.haskellstack.org/en/stable/yaml_configuration/
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
#
-- stack ghci --package dns --package bytestring
-- import Network.DNS.Resolver
-- import Network.DNS.Lookup
-- import qualified Data.ByteString.Char8 as BSC
-- reads newline separated domain names and dumps their A records to an output file.
readFile "/tmp/domains.txt"
>>= return . map BSC.pack . lines
@asheshambasta
asheshambasta / stack-out.log
Created February 4, 2018 11:03
error during `stack install gtk`
er.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Special/Ruler.o )
[ 39 of 209] Compiling Graphics.UI.Gtk.Gdk.DisplayManager ( .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Gdk/DisplayManager.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Gdk/DisplayManager.o )
[ 40 of 209] Compiling Graphics.UI.Gtk.Entry.EntryBuffer ( .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Entry/EntryBuffer.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Entry/EntryBuffer.o )
[ 41 of 209] Compiling Graphics.UI.Gtk.Entry.Editable ( .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Entry/Editable.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Entry/Editable.o )
[ 42 of 209] Compiling Graphics.UI.Gtk.Embedding.Types ( .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Embedding/Types.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Graphics/UI/Gtk/Embedding/Types.
@asheshambasta
asheshambasta / JsonFlatten.scala
Created February 13, 2017 09:16
Very simple + untidy json flattener.
import play.api.libs.json.{JsObject, JsValue, Json}
implicit class JsonFlatten(v: JsValue) {
def toMap(pref: String = ""): Map[String, String] = if (v.isIterable) v.validate[Seq[JsObject]] map { jsons =>
jsons.foldLeft(Map.empty[String, String]) {
case (acc, json) => acc ++ json.toMap(pref)
}
} getOrElse Map.empty[String, String] else v.validate[Map[String, JsValue]] map { mp =>
mp.foldLeft(Map.empty[String, String]) {
@asheshambasta
asheshambasta / return2.hs
Created February 13, 2016 21:21
simple IO stuff
--file: ch07/return2.hs
import Data.Char(toUpper)
isYes :: String -> Bool
isYes str = (toUpper . head $ str) == 'Y'
isGreen :: IO Bool
isGreen = putStrLn "green your favourite colour dawg?" >>
getLine >>= (\str -> return (isYes str))
import Data.Char(toUpper)
main = interact (map toUpper)
@asheshambasta
asheshambasta / transposeText.hs
Last active January 23, 2016 18:37
Transpose a chunk of text in Haskell
-- transpose a chunk of text separated by '\n'
transposeText :: String -> String
transposeText text = unlines (transpose' (lines text))
transpose' :: [String] -> [String]
transpose' sentences
| not (all null sentences) = currentLine : (transpose' (map tail nonEmptySts))
| otherwise = []
where currentLine = [x | x:_ <- nonEmptySts]
@asheshambasta
asheshambasta / AuthenticationSample.scala
Created January 7, 2016 17:11
user authentication example
// authenticate a user with a email + password
trait Authenticable {
def email: String
def password: String
def auth: Option[User] = dbAuthenticate(email, password) // dbAuthenticate is an example method that handles the authentication using a secure DB
def ~ = auth
}