Skip to content

Instantly share code, notes, and snippets.

View noqqe's full-sized avatar
😴

Florian Baumann noqqe

😴
View GitHub Profile
@yogan
yogan / cli-tools-check.sh
Created February 14, 2019 17:08
cli-tools-check.sh
#!/bin/sh
get_installed_version() {
cmd=$1
case $cmd in
"fish")
fish --version | cut -d" " -f3-
;;
"lsd")
lsd --version | cut -d" " -f2-
@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active May 10, 2024 14:34
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@onli
onli / rsa.sh
Created January 8, 2014 17:04
rsa in bash (with bc), a few years old
#!/bin/bash
getPrim() {
local range="$1"
local prim=$(getRandom $range)
until [[ $prim -gt 1 ]] && isPrim $prim;do
prim=$(getRandom $range)
done
echo $prim
return 0
@hggh
hggh / graylog2.md
Last active January 6, 2023 12:18
Graylog2 Debian Packages

WARNING

These packages are obsolete! Please use the official packages from http://www.Graylog2.org

=================================================

@ryancdotorg
ryancdotorg / dnaas.c
Created October 30, 2013 23:20
Wrapper library to use /dev/null as a service on Linux via LD_PRELOAD
/* This is a wrapper library that will give your server the power of
* /dev/null as a service, as seen at http://devnull-as-a-service.com/
*
* Compile:
* gcc -ggdb -shared -fPIC dnaas.c -ldl -lcurl -o libdnaas.so
*
* Try:
* LD_PRELOAD=./libdnaas.so dd if=/dev/sda of=/dev/null bs=8192 count=16
*
* Install:
@bionix
bionix / gist:6856917
Created October 6, 2013 17:43
A puppet cron job snippet for a poll cron task for puppet runs
# establishes a cron entry that runs the puppet agent every 30 minutes, starting
# at a time that is derived from the primary ip-address
# largely based on http://projects.puppetlabs.com/projects/1/wiki/Cron_Patterns
$timeoffset1 = ip_to_cron(1,29)
$timeoffset2 = $timeoffset1 + 30
cron { "puppet":
ensure => present,
command => "puppet agent --onetime --no-daemonize --environment ${environment} --fqdn ${hostname}.${dnsdomain} --logdest syslog > /dev/null 2>&1",
user => "root",
minute => [ $timeoffset1, $timeoffset2 ],
@bluegraybox
bluegraybox / .bashrc_ssh
Created March 8, 2012 02:22
Initialize ssh-agent in .bashrc
# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
@fakechris
fakechris / sync_pinboard_delicious.py
Created October 3, 2011 10:45
Synchronize recent pinboard bookmarks to delicious.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from lxml import etree
from StringIO import StringIO
import time
import os
import urllib
PINBOARD_USER = "username"