Skip to content

Instantly share code, notes, and snippets.

tee|tr " " "\n"|sed '1d'|sed '1~2d'|xargs -I% sh -c 'q=$(echo %|grep -o .|uniq -c|sort -nr);p=$(echo $q|grep -o "^\w*\b");printf $p" ";echo $q|grep -oP "$p\s(.)"|uniq|sort|awk {"print\$2"} ORS="";echo""'
@codehimanshu
codehimanshu / drone-docker-compose.yaml
Last active June 28, 2020 11:06
Drone Docker Setup
version: '3'
services:
drone-server:
image: drone/drone:1
container_name: drone
ports:
- "80:80"
restart: always
environment:
@codehimanshu
codehimanshu / docker-compose.yaml
Created November 14, 2019 05:51
Drone Docker Setup
version: '3'
services:
drone-server:
image: drone/drone:1
container_name: drone
ports:
- "80:80"
restart: always
environment:
kind: pipeline
name: build-release
steps:
- name: publish
image: plugins/ecr
settings:
access_key:
from_secret: aws_access_key_id
environment:
(() => {
//
// GLOBAL VARS AND CONFIGS
//
var lastMessageOnChat = false;
var ignoreLastMsg = {};
var elementConfig = {
"chats": [1, 0, 5, 2, 0, 3, 0, 0, 0],
"chat_icons": [0, 0, 1, 1, 1, 0],
"chat_title": [0, 0, 1, 0, 0, 0, 0],
# Update system packages
sudo apt-get update
sudo apt-get upgrade
# Docker Installation
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sudo apt install docker-compose
@codehimanshu
codehimanshu / flash
Created February 7, 2018 08:56
There's nothing here.
You are wasting your time here. You will not find the solution here.
@codehimanshu
codehimanshu / send_mail.py
Created January 21, 2017 03:53
Trying to send an unauthenticated mail using SMTPD
import smtplib
import email.utils
from email.mime.text import MIMEText
# Create the message
msg = MIMEText('This is the body of the message.')
msg['To'] = email.utils.formataddr(('Recipient', 'himanshuagrawalxxxx@gmail.com'))
msg['From'] = email.utils.formataddr(('Author', 'author@example.com'))
msg['Subject'] = 'Simple test message'
@codehimanshu
codehimanshu / facebook-messenger-bot.php
Last active February 20, 2018 08:10 — forked from remmel/facebook-messenger-bot.php
Basic example of a Facebook Messenger Bot
<?php
// parameters
$hubVerifyToken = 'TOKEN123456abcd';
$accessToken = "xxx";
// check token at setup
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) {
echo $_REQUEST['hub_challenge'];
exit;
}