Skip to content

Instantly share code, notes, and snippets.

View akostadinov's full-sized avatar

Aleksandar N. Kostadinov akostadinov

View GitHub Profile
@yob
yob / README.md
Last active November 8, 2023 12:49
Installing ruby 3.0 with rbenv/ruby-build with openssl 3

Bllergh. This is a real pain.

The openssl extension that ships with ruby 3.0 only compiles against openssl <= 1.1, but now openssl 3.0 is shipped in debian testing/unstable.

Ruby bug here: https://bugs.ruby-lang.org/issues/18658

Version >= 3.0 of the openssl rubygem does compile against openssl 3.0 though.

I use rbenv to manage ruby versions on my system, which uses ruby-build to manage installs.

@Maxattax97
Maxattax97 / README.md
Last active November 13, 2023 12:10 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
  • List every object at each commit.
@andripwn
andripwn / poc.js
Created January 23, 2020 16:29
PDF Bypass - Cross-site Scripting (XSS)
app.alert("XSS")
@jazzytomato
jazzytomato / mock_env.rb
Last active April 3, 2024 00:49
Simple method to mock environment variable in ruby with minitest or other testing framework
# in test_helper.rb (for example)
def mock_env(partial_env_hash)
old = ENV.to_hash
ENV.update partial_env_hash
begin
yield
ensure
ENV.replace old
end
end

Faking DNS from userland

To give false DNS responses from userland we need to handle different type of syscalls : gethostbyname(), gethostbyname2(), getaddrinfo(), getnameinfo(), etc. To cover all these cases, and to prevent leaks to real dns servers, we will use two libraries : libresolv_wrapper and libnss_wrapper.

Installation

Install resolv_wrapper and nss_wrapper, either from sources or from your favorite Linux distribution.

@magnetikonline
magnetikonline / README.md
Last active February 4, 2024 07:45
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
@jkullick
jkullick / fdisk-sector-63.md
Last active December 29, 2016 13:28
Force Sector 63 Boundary in fdisk
fdisk -c=dos -u=cylinders /dev/sdb

Source

@jameslafa
jameslafa / debug.rake
Created July 11, 2016 12:58
Easily debug rake task
desc "switch rails logger to stdout"
task :verbose => [:environment] do
Rails.logger = Logger.new(STDOUT)
end
desc "switch rails logger log level to debug"
task :debug => [:environment, :verbose] do
Rails.logger.level = Logger::DEBUG
end
@detiber
detiber / atomic-openshift-installer-config.yml
Last active August 30, 2018 17:17
openshift-ansible-installer config example
---
version: v3
variant: openshift-enterprise
variant_version: '3.1'
# The deployment key specifies the hosts and roles fo rthe deployment
# and configuration values that apply to the deployment as a whole
deployment:
ansible_config: /usr/share/atomic-openshift-utils/ansible.cfg
ansible_log_path: /tmp/ansible.log
@trevorrowe
trevorrowe / client.rb
Created June 29, 2015 21:03
Ruby Net::HTTP Expect-100 continue PUT bug
require 'net/http'
require 'logger'
req = Net::HTTP::Put.new('/', { 'expect' => '100-continue' })
req.body = 'data'
http = Net::HTTP.new('localhost', 3000)
http.continue_timeout = 1
http.set_debug_output(Logger.new($stdout))
http.request(req)