Skip to content

Instantly share code, notes, and snippets.

View Vitexus's full-sized avatar
🤖
Coding as usual

Cybervitexus Vitexus

🤖
Coding as usual
View GitHub Profile
@jsidhu
jsidhu / ansible_ssl_cert.yaml
Created March 15, 2017 05:14
Ansible snippet to create a self signed ssl certificate
# - name: Generate DH Params (may take several minutes!)
# command: openssl dhparam \
# -out "/data/jenkins_home/ssl/dhparam.pem" 2048
# args:
# creates: "/data/jenkins_home/ssl/dhparam.pem"
#
# - name: Generate ECC Key
# command: openssl ecparam \
# -genkey \
# -name prime256v1 \
@fulv
fulv / main.yml
Last active March 29, 2025 14:42
Ansible - Creating users and copying ssh keypair files to the remote server
Put this in your `local-configure.yml` file, add as many users as you need:
users:
- name: fulvio
sudoer: yes
auth_key: ssh-rsa blahblahblahsomekey this is actually the public key in cleartext
- name: plone_buildout
group: plone_group
sudoer: no
auth_key: ssh-rsa blahblahblah ansible-generated on default
@rverton
rverton / cowroot.c
Created October 21, 2016 14:06
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
@frantorres
frantorres / ncftps.sh
Created October 11, 2016 17:28
ncftp getting and sending files via ftp
ncftpget -R -T -v -u [username] [hostname] [local path] [remote path]
#Ex: ncftpget -R -T -v -u ftpuser ftp.server.work ~/localpath /remotepath
ncftpput -u [username] -p [password] -R [hostname] [remote path] [local path]
#Ex: ncftpput -u ftpuser -p password -R ftp.server.work /remotepath/ ~/localpath/*
@timhodson
timhodson / runCommandAllDockers.sh
Created August 17, 2016 09:13
Run a command on all docker containers
for container in `docker ps -q`; do
# show the name of the container
docker inspect --format='{{.Name}}' $container;
# run the command (date in the case)
docker exec -it $container date;
done
@ridercz
ridercz / KurzyCnb.cs
Last active August 14, 2025 14:47
Class to process exchange rates of Czech National Bank (CNB), including historic data and sample console application.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Net;
using System.Threading.Tasks;
namespace Altairis.KurzyCnb {
class Program {
static void Main(string[] args) {
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@kokes
kokes / Instituce přijímající vklady kromě centrální banky pod zahraniční kontrolou.csv
Created August 9, 2016 11:38
886 současných i bývalých poslanců PSP a jejich funkce v podnicích, které uzavřely smlouvy se státem. Obsahuje neaktuální angažovanosti, sledujte proto 'od' a 'do' sloupce. (Zdroje: Registr smluv, Obchodní rejstřík, psp.cz)
pid od do kan jman funkce tp j p tz dn_x clen_zac clen_kon funk_zac funk_kon ico subjekt npf esa
45244782 1999-09-17 2001-01-03 4 doz_rada člen dozorčí rady Mgr. Zdeněk Zajíček 1967-05-10 45244782 Česká spořitelna, a.s. Akciová společnost Instituce přijímající vklady kromě centrální banky pod zahraniční kontrolou
45317054 1998-10-14 1999-05-20 4 doz_rada člen PhDr. Jan Stráský 1940-12-24 45317054 Komerční banka, a.s. Akciová společnost Instituce přijímající vklady kromě centrální banky pod zahraniční kontrolou
45317054 1998-10-14 1999-05-20 4 doz_rada člen Michal Frankl 1963-12-13 45317054 Komerční banka, a.s. Akciová společnost Instituce přijímající vklady kromě centrální banky pod zahraniční kontrolou
45244782 1996-08-06 1998-09-15 4 doz_rada člen dozorčí rady Ing. Martin Kocourek 1966-12-23 45244782 Česká spořitelna, a.s. Akciová společnost Instituce přijímající vklady kromě centrální banky pod zahraniční kontrolou
@SimonEast
SimonEast / Acceptance.php
Last active March 11, 2021 15:07
Codeception - how to test for redirects
<?php
// Simply place the following two functions in _support/Helper/Acceptance.php
// Then you can call $I->verifyRedirect(...) inside your tests
namespace Helper;
class Acceptance extends \Codeception\Module
{
/**
* Ensure that a particular URL does NOT contain a 301/302
@mikoj
mikoj / Singleton.php
Last active May 12, 2022 14:33
php7 Singleton final private __construct
<?php
interface ISingleton {
public static function getInstance(): ISingleton;
}
abstract class Singleton implements ISingleton {
private static $_instances = [];
final private function __construct () {}