Skip to content

Instantly share code, notes, and snippets.

@ziscloud
ziscloud / memory_layout.md
Created March 26, 2019 14:40 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@ziscloud
ziscloud / convert.md
Created January 3, 2019 03:59 — forked from diorahman/convert.md
How to convert ssh-rsa key to loadable botan's X509

So I need to load the X509 key generated from ssh-keygen.

e.g.

$ ssh-keygen -t rsa -b 1024 -C "bla@bla.com"

PUBLIC

@ziscloud
ziscloud / introrx.md
Created November 4, 2017 16:01 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@ziscloud
ziscloud / java-exception-handling-best-practices.md
Created February 2, 2017 06:24 — forked from raineorshine/java-exception-handling-best-practices.md
5 Great Resources for Exception Handling Best Practices in Java

General Tip

"The trick is to catch exceptions at the proper layer, where your program can either meaningfully recover from the exception and continue without causing further errors, or provide the user with specific information, including instructions on how to recover from the error. When it is not practical for a method to do either of these, simply let the exception go so it can be caught later on and handled at the appropriate level."

Resources

Advantages of Exceptions
Excellent example of separating error-handling code from program logic

Three Rules for Effective Exception Handling
Longer explanation and case study of exception use, including the basic principles of "throw early" and "catch late". Clear and thorough.

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}spring.log}"/>
<property name="METRICS_LOG_PATTERN" value="[${LOG_LEVEL_PATTERN:-%5p}][%d{yyyy-MM-dd HH:mm:ss SSS}][%t]%m%n"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}