Skip to content

Instantly share code, notes, and snippets.

View proditis's full-sized avatar
🚩
Making echoCTF magic happen

Pantelis Roditis proditis

🚩
Making echoCTF magic happen
View GitHub Profile
<?php
/*
* Check that all appropriate calls for name resolution work under the chroot.
*/
$domain="www.echothrust.com";
$inaddr="172.20.3.1";
// If we run from the CLI we're fine
if(is_array($argv) && count($argv)>1)
{
@proditis
proditis / Setting up docker registry on OpenBSD.md
Last active September 21, 2020 08:46
Setting up docker registry on OpenBSD

Setting up docker registry on OpenBSD

pkg_add -vvi go
go get github.com/docker/distribution/cmd/registry
export GOPATH=~/go
mkdir /mnt/registry
export REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/mnt/registry
$GOPATH/bin/registry --version
$GOPATH/bin/registry serve $GOPATH/src/github.com/docker/distribution/cmd/registry/config-example.yml
@proditis
proditis / top-pf-states.pl
Created July 5, 2019 08:10
pfctl -ss | top-pf-states.pl
#!/usr/bin/perl
#
# www.packetmischief.ca
#
my $num_talkers = 10;
my %talkers;
@proditis
proditis / grid-ActionColumn.md
Last active November 2, 2019 10:14
Yii2 GridView actionColumn customizations

The following snippet modifies

  • the default delete action confirmation message
  • adds 4 new actions (generate-ssl, toggle-academic, ban, mail) to the action column
  • adds a custom header action "ban-filtered" which submits the GridView filter data
            [
              'class' => 'yii\grid\ActionColumn',
              'template' => {generate-ssl} {toggle-academic} {view} {update} {delete} {ban} {mail}',
              'header' => Html::a(
@proditis
proditis / ModelSearch.php
Created November 2, 2019 10:26
Customizing Yii2 ModelSearch.php to search FK and other related models. The following example of `SpinQueue` search on a junction model, searches for the name of `target` and `player` on the related tables.
<?php
class ModelSearch extends SpinQueue
{
public $target;
public $player;
/**
* {@inheritdoc}
*/
public function rules()
{
/*
https://github.com/syslog-ng/syslog-ng/issues/1786#issuecomment-348819466
*/
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/un.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
@proditis
proditis / chroot-liblist.sh
Created November 6, 2019 14:20
Scan a file for linked libraries recursively and generate list of distinct libs needed in a chroot
#!/bin/ksh
libslist=$(ldd $1|grep rlib|awk '{print $NF}')
echo $1>paths.lst
for i in $libslist;do
echo $i
ldd $i|grep rlib|awk '{print $NF}'
done|sort -u >>paths.lst
cat paths.lst
@proditis
proditis / atemplate.yml
Created April 12, 2022 10:37
A standalone playbook to process jinja templates. Download `chmod +x` and run
#!/usr/bin/env ansible-playbook
# Stand-alone jinja2 template parser script
# usage:
# atemplate -e TEMPLATE_SOURCE=/source/file -e TEMPLATE_DESTINATION=/destination/file -e template_var1=value1
#
---
- name: Process Jinja2 Template
connection: local
gather_facts: false
tasks:
@proditis
proditis / GitHub-Forking.md
Created April 30, 2022 09:32 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@proditis
proditis / openbsd_xorg_on_virtualbox
Created May 21, 2022 00:39 — forked from darkgeek/openbsd_xorg_on_virtualbox
Better Xorg resolution for OpenBSD as a guest on Virtualbox
# Get from https://www.snip2code.com/Snippet/619307/OpenBSD-Virtualbox-guest-xorg-conf , thanks!
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/X11R6/lib/modules"