Skip to content

Instantly share code, notes, and snippets.

View shirmanov's full-sized avatar
💭
open to new opportunities

Leonid Shirmanov shirmanov

💭
open to new opportunities
  • RBI Group
  • SPb, Russia
  • 11:24 (UTC +03:00)
View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active January 5, 2025 06:01
Multipart-POST Request Using Node.js

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.
@firatkucuk
firatkucuk / delete-slack-messages.js
Last active May 26, 2025 13:43
Deletes slack public/private channel messages, private chat messages and channel thread replies.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = 'SLACK TOKEN';
// Legacy tokens are no more supported.
// Please create an app or use an existing Slack App
@ntamvl
ntamvl / ubuntu-16-increase-maximum-file-open-limit-ulimit-n.md
Last active July 26, 2021 10:06
Ubuntu 16 – how to increase maximum file open limit ( ulimit -n )

Ubuntu 16 – how to increase maximum file open limit ( ulimit -n )

If you are setting up nginx,chances are you will discover your worker_connections is at some low number, such as 1024. You can’t increase this number unless you increase kernel limit as well. First of all run cat /proc/sys/fs/file-max to discover your maximum limit.

abc@ubuntu:~$ cat /proc/sys/fs/file-max
1048576
abc@ubuntu:~$ ulimit -n
1024
@odan
odan / rest_quick_reference.md
Last active September 1, 2021 20:06
REST, RESTful API Quick Reference
@luckydev
luckydev / gist:b2a6ebe793aeacf50ff15331fb3b519d
Last active October 19, 2025 16:22
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@jaimesromero
jaimesromero / bidirectional_sync_s3.md
Last active December 19, 2018 16:28
Bidirectional sync between two s3 buckets

1. Copy new files in [ENV]-wowzer-iphone to [ENV]-wowza-repository

1.1 Configure the SNS topic

1.1.1 Create a new SNS topic

Create a new SNS topic with name: [ENV]-wowzer-iphone-fanout

1.1.2 Update SNS topic policy

@anthonysterling
anthonysterling / provision-minio-droplets
Last active July 13, 2023 01:11
Simple bash script to create 4 Digital Ocean Droplets, each with Persistent Volumes, with a dedicated Load Balancer
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
function log {
local now=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$now] $1"
}
@staaldraad
staaldraad / webdavserv.go
Last active May 23, 2025 12:39
A small webdav server in go
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
"golang.org/x/net/webdav"
extern crate hyper;
extern crate futures;
extern crate pretty_env_logger;
extern crate num_cpus;
extern crate net2;
extern crate tokio_core;
use std::sync::Arc;
use std::thread;
use std::net::SocketAddr;