Skip to content

Instantly share code, notes, and snippets.

@sibosend
sibosend / can’t set the locale
Last active November 27, 2018 04:02
manpath: can’t set the locale; make sure $LC_* and $LANG are correct
# vim /etc/environment
# Add the following
#
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
@sibosend
sibosend / Create self-signed SSL certificate for Nginx
Last active November 27, 2018 04:03 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
Upgrade postgresql from 95 to 96 on Opensuse 42
# currently installed postgresql cluster 9.5
systemctl stop postgresql
# install new version
zypper install postgresql96 postgresql96-contrib postgresql96-devel postgresql96-plpython
postgresql96-pltcl postgresql96-server
@sibosend
sibosend / ffmpeg.md
Last active July 1, 2019 17:42 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@sibosend
sibosend / DockerCheatSheet.md
Last active July 16, 2019 06:04
Docker Cheat Sheet

Table of Contents

  1. Purging All
  2. Images
  3. Containers
  4. Volumes

Purging

Purging All Unused or Dangling Images, Containers, Volumes, and Networks

clean up any resources — images, containers, volumes, and networks — that are dangling (not associated with a container):

@sibosend
sibosend / setup-mongodb34-ubuntu16.sh
Created August 22, 2019 09:41 — forked from sheikhwaqas/setup-mongodb34-ubuntu16.sh
Install mongoDB 3.4 on Ubuntu 16.04 LTS
###############################################################################
# Install mongoDB Server on Ubuntu 16.04 LTS
###############################################################################
# Import the Public Key used by the Ubuntu Package Manager
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
# Create a file list for mongoDB to fetch the current repository
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
@sibosend
sibosend / php-dyld.md
Created August 25, 2019 14:55 — forked from hgrimelid/php-dyld.md
php: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib

After upgrading to Node v.10.9.0 via Homebrew the following error message was thrown from PHP:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found

Reinstall PHP to fix, for me that's:

@sibosend
sibosend / curl.md
Created August 26, 2019 12:15 — 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.

Prerequisite

# For Mac

brew install openssl
# For ubuntu
sudo apt-get install build-essential
sudo apt-get install libgflags-dev libgoogle-glog-dev libgtest-dev libssl-dev
@sibosend
sibosend / gist:467cde19ae439c1bc9333cd9d0be5524
Created December 11, 2019 09:58
Mac OS系统下Bey#ond Com@pare 使用方式
Mac OS系统下Bey#ond Com@pare 使用方式
# 在官网下载并安装成功后,执行如下操作:
# cd /Applications/Beyond Compare.app/Contents/MacOS
# mv BCompare BCompare.real
# touch BCompare
# vim BCompare
```
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"