Skip to content

Instantly share code, notes, and snippets.

@seahrh
seahrh / config
Created May 6, 2021 03:04 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
[sendemail]
smtpencryption = tls
@seahrh
seahrh / .zshrc
Last active January 4, 2022 10:42
zsh config: place $ZSH_CUSTOM/zsh-autosuggestions_custom.zsh
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@seahrh
seahrh / create_training_job.json
Created April 6, 2021 07:05
Create training job on sagemaker
{
"TrainingJobName": "",
"HyperParameters": {
"epochs": "40",
"folds": "5",
"patience": "4",
"batch_size": "32",
"input_shape": "300,300,3",
"pooling": "avg",
"hidden_layer_sizes": "100",
@seahrh
seahrh / s3copy.sh
Created March 31, 2021 01:38
aws s3 copy wildcard matching
aws s3 cp s3://mybucket/models/ models/ --recursive --exclude "*" --include "*effnetb3-20210330-150641*"
[pytest]
filterwarnings =
ignore::DeprecationWarning:tensorflow.*
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
@seahrh
seahrh / get_aws_token.sh
Created March 4, 2021 02:54
AWS session token
aws sts get-session-token --duration-seconds 36000
// Copyright 2007, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
@seahrh
seahrh / fast_predict.py
Last active February 13, 2021 03:33
Faster than Keras model.predict. If you are using tf.keras.Model and predicting via the functional call (as done in Jane Street: Neural Network Starter and other Notebooks), try using:
model.call = tf.function(model.call, experimental_relax_shapes=True)
for (test_df, pred_df) in tqdm(env.iter_test()):
pred = model(data, training = False).numpy()
@seahrh
seahrh / ls_summarize.sh
Created February 4, 2021 06:46
aws s3 -Rlah recursive list files with file size
aws s3 ls --summarize --human-readable --recursive s3://mybucket/mydir/
CREATE OR REPLACE PROCEDURE sp_update_ddl()
AS $$
BEGIN
alter table myschema.mytable add column newcolumn bigint;
EXCEPTION
WHEN OTHERS THEN
raise 'exception in filename.sql';
END
$$ LANGUAGE plpgsql
;