Skip to content

Instantly share code, notes, and snippets.

@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
@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 :

@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;
}
@jonsuh
jonsuh / .bash_profile
Last active February 16, 2024 17:17
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'
@jtremback
jtremback / universal-payment-channels.md
Last active February 27, 2022 13:47
Universal Payment Channels
@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;
@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' => 'ahandler@stewie.schoologize.com',
'date' => '1',
@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: rootshell@corelogics.de (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);