Skip to content

Instantly share code, notes, and snippets.

View pengux's full-sized avatar

Peter Nguyen pengux

View GitHub Profile
@pengux
pengux / macos-tmux-256color.md
Created May 26, 2023 07:45 — forked from joshuarli/macos-tmux-256color.md
Installing tmux-256color for macOS

Installing tmux-256color for macOS

macOS has ncurses version 5.7 which doesn't ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color you can use screen-256color, place this command into your ~/.tmux.conf.

set-option -g default-terminal "screen-256color"

Keybase proof

I hereby claim:

  • I am pengux on github.
  • I am pengux (https://keybase.io/pengux) on keybase.
  • I have a public key ASBVZUnLrYSubjstIltnkb0PofUs5qFk78GBIFMWbjsnTwo

To claim this, I am signing this object:

@pengux
pengux / prettier-js.el
Created April 17, 2017 06:27
Emacs file for Prettier-js
;;; prettier-js.el --- utility functions to format reason code
;; Copyright (c) 2014 The go-mode Authors. All rights reserved.
;; Portions Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are
;; met:
;; * Redistributions of source code must retain the above copyright
@pengux
pengux / war_games_01_talks.md
Created April 19, 2016 06:27
Talks - War Games 01

War Games 01, Computer Security and Hacking

We are at war

  • Blackhat, Whitehat, government, activists hackers constantly trying to get access to computers and data. Sony, Panama Documents, USA, Philippines
  • Reasons can be money, political, religious, military, love, whatever...
  • Computers are weapons and also targets. Data source, botnet, proxy, spam, DDOS
  • Always need to think about security and common sense goes a long way!

Basic server security

@pengux
pengux / server_performance_analysis
Last active April 10, 2016 19:13
Server performance analysis
# http://techblog.netflix.com/2015/11/linux-performance-analysis-in-60s.html
# http://techblog.netflix.com/2015/08/netflix-at-velocity-2015-linux.html
uptime
dmesg | tail
vmstat 1
mpstat -P ALL 1
pidstat 1
iostat -xz 1
free -m
sar -n DEV 1
@pengux
pengux / ssl_letsencrypt_talks.md
Last active March 25, 2016 09:07
ssl_letsencrypt_talks

SSL, TLS and Let's Encrypt

Background

  • SSL = Secure Socket Layer (obsolete) and TLS = Transport Layer Security
  • Netscape developed SSL. v1.0 never published, v2.0 is weak and deprecated in 2011. v3.0 is vulnerable to the POODLE attack and deprecated in 2015. Don't use these anymore!
  • TLS v1.0, v1.1 and v1.2 are still considered to be secure and should be used. Higher (versions) are better.
  • Encrypts communication between for example a client and a server. Can also verify that the server really is the one stated.
  • Can use different ciphers (encryption algorithm)
  • Client and server negotiate about ciphers and keys during the start of the session using the TLS handshake protocol
  • Used with many protocols, not just HTTP.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@pengux
pengux / directives.js
Created December 29, 2013 13:47
Angularjs confirm click directive
/*global window */
define(['angular', 'services'], function(angular, services) {
'use strict';
/* Directives */
angular.module('app.directives', [])
.directive('ngConfirmClick', [
function(){
return {