Skip to content

Instantly share code, notes, and snippets.

@apk
apk / websock.sh
Created April 18, 2012 15:51
A web socket server as a bash script.
#!/bin/bash
# WebSocket shell, start & browse to http://<Host>:6655/
# Requires bash 4.x, openssl.
# Author: [email protected] (which isn't me, apk)
coproc d { nc -l -p 6656 -q 0; }
nc -l -p 6655 -q 1 > /dev/null <<-ENDOFPAGE
HTTP/1.1 200 OK
<html><head><script language="javascript">
var url = location.hostname + ':' + (parseInt(location.port) + 1);
@sebmih
sebmih / curlcsv.php
Created October 17, 2013 06:57
A working script that creates a CSV file using the data from a cURL request.
<?php
$url = 'http://sendgrid.com/';
$user = 'schoologysendgridapi';
$pass = '*********';
$params = array(
'api_user' => $user,
'api_key' => $pass,
'email' => '[email protected]',
'date' => '1',
@josesayago
josesayago / phpcgi-watcher.sh
Last active February 23, 2021 14:31
PHP-CGI Watcher, a little BASH script to kill PHP-CGI orphan processes draining server resources.
#!/bin/bash
#
# @author Jose SAYAGO
# @uri http://josesayago.com/blog/
#
# Process to monitor how many PHP-CGI processes are running, and kill them
# if they exceed the limit
#
# Set the maximum number of CGI Processes allowed
MAX_CGI=25;
@jtremback
jtremback / universal-payment-channels.md
Last active February 27, 2022 13:47
Universal Payment Channels
@jonsuh
jonsuh / .bash_profile
Last active January 20, 2025 10:27
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
@remmel
remmel / facebook-messenger-bot.php
Last active November 5, 2021 18:01
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;
}
@tanaikech
tanaikech / submit.md
Created September 7, 2017 03:55
Uploading Image Files to Slack Using Incoming Webhooks by Google Apps Script

Uploading Image Files to Slack Using Incoming Webhooks by Google Apps Script

This sample script is for uploading image files to Slack using Incoming Webhooks by Google Apps Script.

When users try to upload image files to Slack using Incoming Webhooks, it has been known that although the access token is required to directly upload them, Incoming Webhooks can upload them by using the tag of image_url. In this sample script, it uploads image files (BMP, GIF, JPEG and PNG) on Google Drive to Slack using Incoming Webhooks. The script is written by Google Apps Script.

In this sample, It supposes that there are image files on Google Drive.

Script :

@miguelmota
miguelmota / inode_delete.sh
Created June 5, 2018 07:47
Unix delete file based on inode number
ls -il
find . -inum <inode> | xargs rm
@hokiegeek2
hokiegeek2 / rdma-driver-installation
Last active March 12, 2025 11:22
Instructions for installing rdma drivers on Ubuntu 22.04
#
# Instructions for installing rdma-core at https://github.com/linux-rdma/rdma-core
#
# install required libraries
sudo apt-get install build-essential cmake gcc libudev-dev libnl-3-dev libnl-route-3-dev \
ninja-build pkg-config valgrind python3-dev cython3 python3-docutils pandoc \
infiniband-diags ibverbs-utils -y
# clone and build rdma-core project