Skip to content

Instantly share code, notes, and snippets.

View ryanwoodsmall's full-sized avatar
🍞
🍞 bread 🍞 sandwich 🍞

ryan ryanwoodsmall

🍞
🍞 bread 🍞 sandwich 🍞
View GitHub Profile
@ryanwoodsmall
ryanwoodsmall / README.md
Created May 24, 2020 08:51 — forked from zoilomora/README.md
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

https://hackaday.com/2020/05/21/linux-fu-alternative-shells/

There's no such extant thing as "pdksh" anymore; development has mostly been picked up by mksh, along with the OpenBSD pdksh fork. mksh can be found at: https://www.mirbsd.org/mksh.htm and some portable OpenBSD versions are available at https://github.com/dimkr/loksh and https://github.com/ibara/oksh - of these mksh is probably the most featureful and useful, and is a mostly drop-in replacement for any ksh88/POSIX sh script or interactive environment.

Note, however, that pdksh derivatives are all more like the classical "ksh88" than "ksh93." The Korn shell grew a number of very useful features - associative arrays, floating point math, etc. - in the newer ksh93 version. Bash has adopted some of these, but not all, and the pdksh continuations/clones will likely stick with ksh88 compatibility. The old AT&T AST repo has relatively up-to-date (and open source) ksh93: https://github.com/att/ast and the ksh2020 branch has a build system not stuck in 199

@ryanwoodsmall
ryanwoodsmall / busybox-etc_inetd.conf
Created April 27, 2020 16:12
busybox-etc_inetd.conf
chargen dgram udp wait root internal
chargen stream tcp nowait root internal
daytime dgram udp wait root internal
daytime stream tcp nowait root internal
discard dgram udp wait root internal
discard stream tcp nowait root internal
echo dgram udp wait root internal
echo stream tcp nowait root internal
time dgram udp wait root internal
time stream tcp nowait root internal
@ryanwoodsmall
ryanwoodsmall / httpd_mod_proxy_ftp.conf
Created April 24, 2020 02:54
httpd_mod_proxy_ftp.conf
# proxy requests /ftp/host.domain.tld/... to a real ftp server
ProxyRequests On
ProxyPreserveHost On
RewriteEngine On
RewriteRule "^/ftp/(.*)$" "ftp://$1" [P]
@ryanwoodsmall
ryanwoodsmall / build.sh
Last active April 14, 2020 04:41
opengit on linux
#!/bin/sh
# segfaulting on clone, but builds now
# needs:
# bmake
# libbsd
# libmd
# libfetch
# libressl/openssl
# zlib
bmake clean
@ryanwoodsmall
ryanwoodsmall / jenkins-bitbucket_docker-compose.yml
Created April 9, 2020 04:04
jenkins-bitbucket_docker-compose.yml
version: "3"
services:
jenkins:
image: jenkins/jenkins:lts
restart: always
ports:
- "18080:8080"
volumes:
- jenkins:/var/jenkins_home
bitbucket:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
char *findbin(char *b);
int main(int argc, char **argv, char **envp)
{
char *s = "dash";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
char* findbin(char* s);
char* findbin(char* s)
{
char* p = getenv("PATH");
@ryanwoodsmall
ryanwoodsmall / 32-64-dockerfile
Created February 6, 2020 20:43
32-64-dockerfile
FROM i386/centos:7
#FROM centos:7
RUN \
uname -m | sed 's/^/buildhost: /g' \
&& echo '#!/bin/bash' > /entrypoint.sh \
&& if $(bash -c 'set | grep ^HOSTTYPE= | cut -f2 -d=' | grep -q '86$') ; then \
echo 'this is x86' \
&& echo 'linux32 "${@}"' >> /entrypoint.sh ; \
else \
@ryanwoodsmall
ryanwoodsmall / netpbmto.py
Last active August 28, 2020 21:39
netpbmto.py
#!/usr/bin/env python3
#
# show conversions for a (custom built) netpbm
#
# ex: ./netpbmto.py | egrep "\['png'.*'xpm'\]"
#
from os import walk
import re