Skip to content

Instantly share code, notes, and snippets.

@programmerq
programmerq / chatgpt-render.js
Last active May 14, 2023 15:56
renderer for chatgpt code blocks that can have a visual representation.
// ==UserScript==
// @name Render SVGs in Code Blocks
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Render SVGs in code blocks on https://chat.openai.com
// @author Jeff Anderson
// @match https://chat.openai.com/*
// @require https://github.com/mdaines/viz.js/releases/download/v2.1.2/viz.js
// @require https://github.com/mdaines/viz.js/releases/download/v2.1.2/full.render.js
// @grant none
@programmerq
programmerq / README.md
Last active November 18, 2023 17:20
Teleport Auto Updater

Simple systemd service that checks /etc/teleport.yaml for the proxy URL, checks the teleport version of the proxy, and attempts to upgrade and apt-mark hold the teleport package. timer unit kicks it off once a day.

to install:

dependencies include curl and yq

apt-get update && apt-get -y install curl
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq && chmod +x /usr/local/bin/yq
FROM php:apache
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
COPY --chown=www-data:www-data . /var/www/html/
@programmerq
programmerq / README
Created November 13, 2018 13:38 — forked from xbb/README
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
$ docker run --rm -it node:latest /bin/bash
Unable to find image 'node:latest' locally
latest: Pulling from library/node
cd0a524342ef: Already exists
e39c3ffe4133: Already exists
85334a7c2001: Already exists
4c546d9d6a84: Already exists
fa1ae2b8eedb: Pull complete
2e2f1cff6e9f: Pull complete
aa7b15936229: Pull complete
$ sudo capsh --print
Current: = cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_linux_immutable,cap_net_bind_service,cap_net_broadcast,cap_net_admin,cap_net_raw,cap_ipc_lock,cap_ipc_owner,cap_sys_module,cap_sys_rawio,cap_sys_chroot,cap_sys_ptrace,cap_sys_pacct,cap_sys_admin,cap_sys_boot,cap_sys_nice,cap_sys_resource,cap_sys_time,cap_sys_tty_config,cap_mknod,cap_lease,cap_audit_write,cap_audit_control,cap_setfcap,cap_mac_override,cap_mac_admin,cap_syslog,cap_wake_alarm,cap_block_suspend,37+ep
Bounding set =cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_linux_immutable,cap_net_bind_service,cap_net_broadcast,cap_net_admin,cap_net_raw,cap_ipc_lock,cap_ipc_owner,cap_sys_module,cap_sys_rawio,cap_sys_chroot,cap_sys_ptrace,cap_sys_pacct,cap_sys_admin,cap_sys_boot,cap_sys_nice,cap_sys_resource,cap_sys_time,cap_sys_tty_config,cap_mknod,cap_lease,cap_audit_write,cap_audit_control,cap_s
$ docker run --rm -it debian:jessie bash
Unable to find image 'debian:jessie' locally
jessie: Pulling from library/debian
5040bd298390: Already exists
Digest: sha256:abbe80c8c87b7e1f652fe5e99ff1799cdf9e0878c7009035afe1bccac129cad8
Status: Downloaded newer image for debian:jessie
root@1bd72c3f9c4a:/# cat /etc/localtime
TZif2UTCTZif2UTC
UTC0
root@1bd72c3f9c4a:/# date
@programmerq
programmerq / regv2cdn.sh
Created February 8, 2017 21:37
Registry v2 Push and Pull Script
#!/bin/bash
# Shell scripts for push/pull to v2 registry
#
# - Get a token.
# - Push a blob.
# - Pull that blob repeatedly.
#
# Tested on OS X 10.10.3, curl 7.38.0, jq-1.4
#
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9cd867541c6f mysql "/entrypoint.sh mysql" 3 seconds ago Up 2 seconds 0.0.0.0:32770->3306/tcp database
e4b8aabb2d70 node "bash" 24 hours ago Up 24 hours furious_lamarr
e335dc673fc6 nginx:alpine "nginx -g 'daemon off" 38 hours ago Up 38 hours 443/tcp, 0.0.0.0:801->80/tcp agitated_hypatia
@programmerq
programmerq / docker.service
Created September 23, 2016 16:10
fresh centos 7 docker 1.12.1 install
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker