Skip to content

Instantly share code, notes, and snippets.

@emaniacs
emaniacs / Realtime monitoring file
Last active January 20, 2022 01:28
untitled #tail #awk #grep
Using tail
`$ tail -f output.log`
Filter the text in realtime using `grep`
`$ tail -f output.log | grep Error`
Filter the text in realtime using `awk`
@emaniacs
emaniacs / telegram-bot
Last active July 16, 2020 03:46
sending document image or text into telegram channel with bot
#!/usr/bin/env bash
## this script sending message into telegram channel
OSNAME=$(uname)
get_fullpath() {
if [[ $OSNAME == "Linux" ]] ; then
readlink -m $1
elif [[ $OSNAME == "Darwin" ]] ; then
realpath $1

Keybase proof

I hereby claim:

  • I am emaniacs on github.
  • I am aredhi (https://keybase.io/aredhi) on keybase.
  • I have a public key whose fingerprint is EF58 516E F433 886B BE13 6765 EDC0 60CF 7EDB F975

To claim this, I am signing this object:

@emaniacs
emaniacs / big_integer_random.php
Created January 16, 2013 07:37
Big integer random performance. Using rand() function and looping.
<?php
$t1Start = microtime(true);
$rand1 = rand(100000, 1000000);
$t1End = microtime(true);
//sleep(3);
$rand2 = '';
$length = 6;
$t2Start = microtime(true);