Skip to content

Instantly share code, notes, and snippets.

View samnang's full-sized avatar
🚀

Samnang Chhun samnang

🚀
View GitHub Profile
@samnang
samnang / gist:1759336
Created February 7, 2012 11:52
Install Bash version 4 on MacOS X
# Install Bash 4 using homebrew
brew install bash
# Or build it from source...
curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz
tar xzf bash-4.2.tar.gz
cd bash-4.2
./configure --prefix=/usr/local/bin && make && sudo make install
# Add the new shell to the list of legit shells
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>
Hello from Somleng!
</Message>
</Response>
@samnang
samnang / gist:1213607
Created September 13, 2011 11:11
Git global configuration
$ git config --global user.name "Samnang Chhun"
$ git config --global user.email "samnang.chhun@gmail.com"
$ git config --global color.ui true
$ git config --global alias.st status
$ git config --global alias.ci commit
$ git config --global alias.br branch
$ git config --global alias.co checkout
$ git config --global alias.df diff
@samnang
samnang / console.rb
Created January 2, 2011 02:01
Tips – Simulate Rails Console in Ruby Project
#!/usr/bin/env ruby
app_path = File.expand_path("../", File.dirname(__FILE__))
boot_path = File.join(app_path,"boot")
command = "irb -r irb/completion -r #{boot_path}"
exec command
#!/usr/bin/env bash
# This script clones all repos in a GitHub org
# It requires the GH CLI: https://cli.github.com
# It can be re-run to collect new repos and pull the latest changes
set -euo pipefail
USAGE="Usage: gh-clone-org <user|org>"
@samnang
samnang / mac-setup-redis.md
Created September 6, 2021 02:04 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@samnang
samnang / test_private_key.pem
Last active July 3, 2020 08:35
Bongloy CMS Request Signing
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDhcS9EE66BG3ph
XixOU7mQYYM19M7Hi/u+P5zK5ZFxBRUbY9wLDvUIk1ARBZ1n1FZ4d/hYegrpxnVz
nvFn6KQSivSu93dRThY67YFY+xnzZ6r8atfzqayb7BFuDyd8ElO3dKvxHybCSKyH
RT1Mo9ZAVcLbbpepMYjzQqnESRpNQOIslRl6fALLW/Cg38yD3gVLPVzSry028Yk3
XjjliPaiuCn5ASXgxf2A4VkSpzM+3t2wF0P/PzaV3g4SVaPOERrarUiYDrN00ooq
1fmf4ta2WNgU3tr/5faJnggdtA/UmjTR/pfSs78kd7vn6TMyBMrPmCLoitol9Y87
64ztAmR0M/12UWuE1B4KciVO1UoOkxrfubvaySSDhtcT1kUA2baEXIi68hjlfrMo
da+VnqFnhnPOLONYHj9fPWPp2dSR4HjIt8aG3JkbEOAIQPD+Pr9lqRgy6WKZlOmU
zxnUfWgqsJM9DEt0nrMzPnAIRDWtIk/ABhN2cO1UK/zaQQWl2IHnGUZ83XlNWAtF
@samnang
samnang / AgentNetworkApp.java
Last active March 19, 2020 07:51
Bongloy Agent Network Code Snippits
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse.BodyHandlers;
import java.nio.file.*;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.*;
import java.time.Instant;
import java.util.Base64;
@samnang
samnang / gist:b38c3e378228aa6525389c3876c2c8ee
Created July 17, 2019 15:30 — forked from olivierlacan/gist:4062929
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@samnang
samnang / gist:1159235
Created August 20, 2011 15:29
Completely remove mysql-server
sudo apt-get purge mysql-server
sudo apt-get purge mysql-client
sudo apt-get purge mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-cache rdepends mysql-server
sudo apt-cache rdepends mysql-client