Skip to content

Instantly share code, notes, and snippets.

@sakal
sakal / script-template.sh
Created December 27, 2020 23:11 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@sakal
sakal / gist:722ce2ef8bfda8235e1b5009e888bc65
Created March 28, 2018 14:35
py3.6 string format vs concat
> $ python3.6 [±claymore-115 ✓▴]
Python 3.6.5rc1 (default, Mar 14 2018, 06:54:23)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import timeit
>>> def d1(a, b):
... return a + '_' + b
...
>>> def d2(a, b):
... return '%s_%s' % (a, b)
@sakal
sakal / keytool-gen-x509.txt
Last active July 23, 2017 11:35
Generating X.509 Certificates
# https://www.playframework.com/documentation/2.5.x/CertificateGeneration
# https://jamielinux.com/docs/openssl-certificate-authority/create-the-intermediate-pair.html
# https://docs.docker.com/engine/security/certificates/
# http://pki-tutorial.readthedocs.io/en/latest/simple/root-ca.conf.html
# https://support.ssl.com/Knowledgebase/Article/View/19/0/der-vs-crt-vs-cer-vs-pem-certificates-and-how-to-convert-them
X.509 Certificates
Public key certificates are a solution to the problem of identity. Encryption alone is enough to set up a secure connection, but there’s no guarantee that you are talking to the server that you think you are talking to. Without some means to verify the identity of a remote server, an attacker could still present itself as the remote server and then forward the secure connection onto the remote server. Public key certificates solve this problem.
Vladimir Grishin, [24.07.16 11:26] aka @Vogre at t.me/react_js
но вообще в целом
//actioncreator
const fetchData(pageNum) = dispatch=>
fetch('mydata', {pageNum}).then(data=>dispatch({type: 'DATA_RECEIVED', payload: {data, pageNum}}))
//reducer
switch(action.type){
case 'DATA_RECEIVED':
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
@sakal
sakal / Xorg.0.log
Last active February 28, 2016 22:23
[ 7.647]
X.Org X Server 1.18.1
Release Date: 2016-02-08
[ 7.647] X Protocol Version 11, Revision 0
[ 7.647] Build Operating System: Linux 3.16.0-4-amd64 x86_64 Debian
[ 7.647] Current Operating System: Linux sakalz 4.4.0-1-amd64 #1 SMP Debian 4.4.2-3 (2016-02-21) x86_64
[ 7.647] Kernel command line: BOOT_IMAGE=/vmlinuz-4.4.0-1-amd64 root=/dev/mapper/sakalz--vg-root ro quiet cgroup_enable=memory swapaccount=1 radeon.dpm=1
[ 7.647] Build Date: 09 February 2016 11:06:03AM
[ 7.647] xorg-server 2:1.18.1-1 (http://www.debian.org/support)
[ 7.647] Current version of pixman: 0.33.6
sakalz# aptitude search "~ifirmware-linux"
i firmware-linux - Binary firmware for various drivers in the Linux kernel (meta-package)
i A firmware-linux-free - Binary firmware for various drivers in the Linux kernel
i firmware-linux-nonfree - Binary firmware for various drivers in the Linux kernel (meta-package)
sakalz#
sakalz# aptitude search "~ilibgl1-mesa"
i A libgl1-mesa-dev - free implementation of the OpenGL API -- GLX development files
i A libgl1-mesa-dri - free implementation of the OpenGL API -- DRI modules
i A libgl1-mesa-dri:i386
#!/bin/sh
#ARCH=`uname -m`
if [ -z "$ARCH" ]; then
#case "$( uname -m )" in
case "i686" in
i686) ARCH=i686 ;;
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;

Keybase proof

I hereby claim:

  • I am sakal on github.
  • I am sakal (https://keybase.io/sakal) on keybase.
  • I have a public key whose fingerprint is 9578 47B8 FFD8 4382 7E67 C882 B04D 90A1 2B5B F677

To claim this, I am signing this object:

> bower search jsonrpc
Search results:
angular-jsonrpc git://github.com/ajsd/bower-angular-jsonrpc.git
angular-jsonrpc-q git://github.com/jaPajaap/angular-jsonrpc.git
jquery-jsonrpcclient git://github.com/Textalk/jquery.jsonrpcclient.js.git
angular-jsonrpc-alt git://github.com/ngyewch/bower-angular-jsonrpc.git
bower-angular-jsonrpc-alt git://github.com/ngyewch/bower-angular-jsonrpc.git
jquery-jsonrpc git://github.com/datagraph/jquery-jsonrpc.git
jquery-jsonrpc2.0 git://github.com/hagino3000/jquery-jsonrpc2.0.git