Skip to content

Instantly share code, notes, and snippets.

View cnpdev's full-sized avatar

Tsvetelin Petkov cnpdev

  • BIX.BG
  • Sofia, Bulgaria
View GitHub Profile
#!/usr/bin/sudo ruby
#
# revealer.rb -- Deobfuscate GHE .rb files.
#
# This is simple:
# Every obfuscated file in the GHE VM contains the following code:
#
# > require "ruby_concealer.so"
# > __ruby_concealer__ "..."
@cnpdev
cnpdev / disable_spectre.md
Created April 10, 2020 11:15 — forked from rizalp/disable_spectre.md
Disable Spectre/Meltdown Mitigation

In /etc/default/grub, modify:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off"

Then sudo update-grub

@cnpdev
cnpdev / web-servers.md
Created January 18, 2020 11:02 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@cnpdev
cnpdev / set-wallpaper.sh
Created January 18, 2020 11:02 — forked from willurd/ set-wallpaper.sh
Set the Desktop Background for all of your open Spaces in Mountain Lion
read -e IMAGE;
defaults write com.apple.desktop Background "{default = {ImageFilePath='$IMAGE'; };}"
killall Dock
@cnpdev
cnpdev / prettyprint.swift
Created November 5, 2019 16:13 — forked from 3lvis/prettyprint.swift
JSON Pretty Print Swift 5
print(String(data: try! JSONSerialization.data(withJSONObject: dict, options: .prettyPrinted), encoding: .utf8)!)
@cnpdev
cnpdev / simple-git-branching-model.md
Created April 27, 2019 11:59 — forked from jbenet/simple-git-branching-model.md
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@cnpdev
cnpdev / osx_install.sh
Created December 14, 2018 09:39 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@cnpdev
cnpdev / apfs_cli_tools.txt
Created June 12, 2018 21:17 — forked from timsutton/apfs_cli_tools.txt
apfs tools in Sierra
➜ ~ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.1
BuildVersion: 16B2333a
➜ ~ ls -l /System/Library/Filesystems/apfs.fs/Contents/Resources
total 2088
-rwxr-xr-x 1 root wheel 349760 22 Sep 03:48 apfs.util
-rwxr-xr-x 1 root wheel 352880 22 Sep 03:48 apfs_invert
@cnpdev
cnpdev / font_letter_check.txt
Created May 16, 2018 13:41 — forked from marcospedreiro/font_letter_check.txt
/u/martinus test pattern to check how distingushable characters are for a font
From: https://www.reddit.com/r/programming/comments/8jjq33/11_best_programming_fonts/dz0xxs5/
------
o0O s5S z2Z !|l1Iij {([|})] .,;: ``''""
a@#* vVuUwW <>;^°=-~ öÖüÜäÄßµ \/\/
the quick brown fox jumps over the lazy dog
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
0123456789 &-+@ for (int i=0; i<j; ++i) { }
@cnpdev
cnpdev / iptables
Created February 24, 2016 14:39 — forked from crashdump/iptables
### BEGIN INIT INFO
# Provides: firewall-ipv4
# Required-Start: $network
# Required-Stop: $network
# Default-Start: S 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall rules
# Description: Simple script to initialise an iptables firewall
### END INIT INFO