Skip to content

Instantly share code, notes, and snippets.

@Serg0
Serg0 / curl.md
Created July 8, 2019 21:59 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@saicharanreddyk
saicharanreddyk / sfdx commands list
Last active January 25, 2024 00:16
sfdx commands list
C:\Users\Saicharan Reddy K>sfdx force:doc:commands:list
WARNING: The command "DocListCommand" has been deprecated and will be removed in v49.0 or later. Use "sfdx commands" instead.
=== Commands
force:alias:list # list username aliases for the Salesforce CLI
force:alias:set # set username aliases for the Salesforce CLI
force:analytics:template:create # add an Analytics template to your workspace
force:apex:class:create # create an Apex class
force:apex:execute # execute anonymous Apex code
force:apex:log:get # fetch the last debug log
force:apex:log:list # list debug logs
@rikka0w0
rikka0w0 / vsftpd_setup_anonymous_upload_download.md
Last active May 8, 2024 14:27
[vsftpd]Setup anonymous upload and download FTP server

Install vsftpd

# Install
sudo apt update
sudo apt install vsftpd
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig

# Firwall rules
sudo ufw allow ftp-data
sudo ufw allow ftp
@taisyo7333
taisyo7333 / ruby_on_rails5.md
Last active March 12, 2018 16:37
ruby on rails5 はまったこと

現象

# bundle exec rails c
Could not find rake-12.3.0 in any of the sources
Run `bundle install` to install missing gems.

解決

# bundle install --binstubs
@nitred
nitred / ssh_utils.md
Last active December 11, 2024 11:49
SSH Tunneling (port forwarding + reverse port forwarding + SOCK5)

About

SSH tunneling and port forwarding snippets and utils

Table of Contents

  • SOCK5 tunnel everything: Link
  • Local port forwarding: Link
  • Remote port forwarding: Link
@kcore
kcore / sidekiq_manager.rb
Created November 28, 2016 12:32
a load balancer for sidekiq jobs!
module Amura
class SidekiqManager
# a datastructure to maintain queue meta data. the structure of which is {host_name: {queue_name:{min:1,max:1,conc:10,latency:1,queue_size:10,kill_idle:-1, tags:['default'], total_checks:1,current_check:0}}}
# host_name - name of the machine where its running. useful in a distributed environment where app is running on mulitple instances
# queue_name - name of the queue (which you can mention in the sidekiq worker as sidekiq_options :queue => :mailer )
# min: minimum number of processes required to process this queue on this machine.
# max: maximum number of processes permitted to process this queue on this machine. a upper limit to avoid memory overflow and unlimited process spawning.
# conc: concurreny (number of worker threads) for each of the processes. this is -C option given while booting up sidekiq.
# latency: this is the default safe latency which is permissable for this queue. anything beyond this will trigger new p
@joshgarnett
joshgarnett / lets-encrypt-route53.rb
Last active March 17, 2021 09:01
Ruby script to use as a hook for the letsencrypt.sh client
#!/usr/bin/env ruby
require 'aws-sdk'
#
# This script requires you to have the following environment variables set:
# AWS_REGION="us-west-2"
# AWS_ACCESS_KEY_ID="<YOUR_KEY>"
# AWS_SECRET_ACCESS_KEY="<YOUR_SECRET_KEY>"
#
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active December 8, 2024 22:08
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@eknkc
eknkc / postgres_metrics.sql
Created February 27, 2016 00:49 — forked from sorentwo/postgres_metrics.sql
Postgres metric select statements
-- bgwriter
SELECT checkpoints_timed FROM pg_stat_bgwriter;
SELECT checkpoints_req FROM pg_stat_bgwriter;
SELECT write_time FROM pg_stat_bgwriter;
SELECT sync_time FROM pg_stat_bgwriter;
SELECT buffers_checkpoint FROM pg_stat_bgwriter;
SELECT buffers_clean FROM pg_stat_bgwriter;
SELECT maxwritten_clean FROM pg_stat_bgwriter;
SELECT buffers_backend FROM pg_stat_bgwriter;
SELECT buffers_backend_fsync FROM pg_stat_bgwriter;
@subfuzion
subfuzion / curl.md
Last active May 21, 2025 09:15
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.