Skip to content

Instantly share code, notes, and snippets.

package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"github.com/davecgh/go-spew/spew"
"io/ioutil"
"log"
@b4ldr
b4ldr / git.py
Last active April 26, 2023 11:21
git get user
import git
import os
import pwd
import shutil
from git.util import get_user_id
from pathlib import Path
CHECKOUT = Path("/tmp/profile")
shutil.rmtree(CHECKOUT, ignore_errors=True)
class classtest1 ($classfoobar) {
inline_template('<% @classfoobar.each {|i| i.upcase! } %>')
notice($classfoobar)
}
class classtest2 ($classfoobar) {
inline_template('<% @classfoobar.each {|i| i.upcase! } %>')
notice($classfoobar)
}
class classtest3 ($classfoobar = ['foo', 'bar']) {
inline_template('<% @classfoobar.each {|i| i.upcase! } %>')
@b4ldr
b4ldr / console.log
Created January 10, 2022 13:57
scrap dell drivers
$ ./dell.py -vvvv poweredge-r430 [14:52:33]
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.dell.com:443
DEBUG:urllib3.connectionpool:https://www.dell.com:443 "GET /support/home HTTP/1.1" 301 0
DEBUG:urllib3.connectionpool:https://www.dell.com:443 "GET /support/home/en-uk HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://www.dell.com:443 "GET /support/driver/en-uk/ips/api/driverlist/fetchdriversbyproduct?productcode=poweredge-r430&oscode=RHEL8 HTTP/1.1" 200 None
Seagate ST5A for model number(s) DL1800MM0159 and DL2400MM0159.:
15 Dec 2021
https://dl.dell.com/FOLDER07629076M/1/SAS-Drive_Firmware_T5GTX_LN64_ST5A_A00.BIN
This release contains firmware version CSJ8 for STX drives. Vendor model numbers ST4000NM017A, ST2000NM013A, ST1000NM005A.:
@b4ldr
b4ldr / example.sql
Last active December 31, 2020 11:13
SELECT hosts.host
FROM ((hosts
INNER JOIN host_resources on hosts.id = host_resources.host_id
INNER JOIN resources on resources.id = host_resources.resource_id))
WHERE resources.name = 'Motd';
mongodb::dbs:
testdb:
user: user1
password_hash: a15fbfca5e3a758be80ceaf42458bcd8
#include <stdio.h>
#include <curl/curl.h>
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
CURLcode cas_curl_ssl_ctx(CURL *curl, void *sslctx, void *parm)
{
#!/usr/bin/env python3
"""A simple example of how to access the Google Analytics API."""
from argparse import ArgumentParser
from apiclient.discovery import build
from google.oauth2 import service_account
def get_args():
class Foo
@@count = 1
def self.count
@@count
end
def self.increment
@@count += 1
end
end
Puppet::Functions.create_function(:'test::foo') do
class resolv {
case $hostname {
/^[Abc]/: {
resolv::resolv_config { 'Default':
domain => "mydomain.local",
}
}
}
}