Skip to content

Instantly share code, notes, and snippets.

View Dmitry-N-Medvedev's full-sized avatar
🎯
Focusing

Dmitry N. Medvedev Dmitry-N-Medvedev

🎯
Focusing
View GitHub Profile
@Dmitry-N-Medvedev
Dmitry-N-Medvedev / CSP.md
Created February 17, 2018 16:33 — forked from corburn/CSP.md
Nginx server notes

The following is from scotthelme.co.uk

Content Security Policy

with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy), you can tell the browser that it can only download content from the domains you explicitly allow http://www.html5rocks.com/en/tutorials/security/content-security-policy/ https://www.owasp.org/index.php/Content_Security_Policy I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'

@Dmitry-N-Medvedev
Dmitry-N-Medvedev / alpine-install.sh
Created May 17, 2018 09:06 — forked from thde/alpine-install.sh
A script to install alpine linux on a dedicated server. Tested on Hetzner, Kimsufi / OVH
#!/bin/sh
set -ex
PATH=/bin:/sbin:/usr/bin:/usr/sbin
KEYMAP="us us"
HOST=alpine
USER=anon
ROOT_FS=ext4
BOOT_FS=ext4
@Dmitry-N-Medvedev
Dmitry-N-Medvedev / alpine-install.sh
Created May 17, 2018 09:44 — forked from Jmoati/alpine-install.sh
A script to install alpine linux. Tested on Hetzner, Kimsufi / OVH
#!/bin/sh
set -ex
PATH=/bin:/sbin:/usr/bin:/usr/sbin
KEYMAP="us us"
HOST=alpine
USER=anon
ROOT_FS=ext4
BOOT_FS=ext4
@Dmitry-N-Medvedev
Dmitry-N-Medvedev / spawnSync_example.js
Created May 21, 2018 16:53 — forked from myconode/spawnSync_example.js
Example use of spawnSync
'use strict'
// https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options
const spawn = require('child_process').spawnSync
// object returned when process has completely exited
const child = spawn('which', ['node'] )
// view status
console.log( child.status )
@Dmitry-N-Medvedev
Dmitry-N-Medvedev / convert_flac_to_aac.sh
Created July 13, 2023 22:24 — forked from kerma/convert_flac_to_aac.sh
Convert all flac files in folder to m4a using ffmpeg and libfdk_aac
# on os x use brew to get ffmpeg with libfdk_aac
brew install ffmpeg --with-fdk-aac
# convert and use m4a as file extension
find . -name '*.flac' -exec sh -c 'ffmpeg -i "$1" -c:a libfdk_aac -b:a 320k "${1%.flac}.m4a"' _ {} \;

My personal notes for building zig 0.12.0-dev.xxxx on an M2 Max.

This setup should work on any M1 or M2 Mac, but you must check other models yourself. Currently it also works on an Intel Mac, with one small difference: homebrew has a different default path there.

DO YOU REALLY NEED TO BUILD FROM SOURCE?

"First of all, if your goal is to install a specific version of Zig, you can find pre-built tarballs on the download page. You could also try installing Zig from a package manager. Finally, there is zig-bootstrap to cross-compile an installation of Zig from source for any target. When using zig-bootstrap, be sure to check out the git tag corresponding to the version you want to build, as master branch is not kept in any coherent state."