Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
#!/bin/bash # https://gitlab.com/sc0ttj/Pkg/merge_requests/21#note_262770355 # /etc/apt/sources.list should have the following line (non-free & contrib are optional) #deb http://ftp.de.debian.org/debian buster main non-free contrib . /etc/DISTRO_SPECS UPDATE_REPO=no INSTALL_WEBSERVER=no #On puppylinux if webserver="busybox httpd" sinccy httpd is included in puppy's busybox. #webserver=nginx webserver="busybox httpd" #httpd is part of busybox, so if httpd is specified we shouldn't install any web server. # Try running these web servers before installing anything web_server_fallbacks=( "nginx" "apache" "lighttpd" "httpd" ) #If for some reason there is no webserver installed, then try installing one of these. web_server_install_fallbacks=( "${web_server_fallbacks[@]}" ) port=80 #If port isn't 80 then maybe we need to run pkg with proxychains. config_file="" #Leave this black for the default settings #config_file=/etc/httpd2.conf repo_name_in=${DISTRO_BINARY_COMPAT}-main #Comment repo_url_in=http://archive.ubuntu.com/ubuntu/ #TODO: look this up if it isn't specified repo_url_out=http://archive.ubuntu.cherrypicked.com/ubuntu/ repo_name_out=${repo_name_in//-main/-cherrypicked} [ -z "$repo_url_out" ] && localhost #Uncoment the next line to use a previously generated awk program #AWK_PRG_Path_in=/usr/share/pkg/testing/filter_repo #Uncoment the next line to generate a new awk program AWK_PRG_Path_out=/usr/share/pkg/testing/filter_repo #Or comment out both lines above to use an inline (i.e. string) based awk program ########### Chose a repo file to filter distro_in=${DISTRO_BINARY_COMPAT}; distro_out="$distro_in" distro_ver_in=${DISTRO_COMPAT_VERSION}; distro_ver_out="$distro_ver_in" stream_in=main; stream_out=cherrypicked ########### Some Document Paths #https://stackoverflow.com/questions/10674867/nginx-default-public-www-location #www_root=/usr/share/nginx/html #This is the default web folder for nginx in ubuntu www_root=/var/www/html #This was also suggested #www_root=/var/www/ #This is the default web folder for apache. REPO_DB_DOC_FILE_in=/var/packages/Packages-${distro_in}-${distro_ver_in}-${stream_in} #REPO_DB_DOC_FILE_out=~/Packages-${distro_ver_out}-${distro_ver_out}-${stream_out} TMPDIR=/tmp DL_FNAME=ppa_Packages.gz DL_FILE_EX=.gz arch='i386' case $(uname -m) in i*86) arch='i386' ;; *64) arch='amd64' ;; esac repo_root_path=repo/debian doc_path=${www_root}/${repo_root_path}/dists/${distro_ver_out}/${stream_out}/binary-${arch} #/Packages.gz mkdir -p $doc_path #This is where we will save the repo db doc file on our system. download_url=$(echo "$repo_url_in" | sed -e 's#/$##g')/dists/${distro_ver_in}/${stream_in}/binary-${arch}/Packages.gz function is_running(){ local repo_url=$1 repo_urls=( "$repo_url" "localhost" "127.0.0.1" ) for a_repo_url in "${repo_urls[@]}"; do if [ -z "$(wget --spider -S "$repo_url" 2>&1 | awk '/HTTP\// {print $2}')" ]; then if [ "$repo_url" != "$a_repo_url" ]; then echo "Webserver is running but hostname mapping is broken" >&2 echo "Check hosts file, dns cache or dns server" >&2 fi echo "true" else echo "false" fi done } function set_webserver_options(){ local webserver=$1 case "$webserver" in *) options=() for option in -p -h -c; do case "$option" in -p) [ ! -z "$PORT" ] && options+=( "$_p" "$PORT" ); ;; -h) [ ! -z "$www_root" ] && options+=( "$_h" "$www_root" ); ;; -c) [ ! -z "$config_file" ] && options+=( "$_c" "$config_file" ); ;; esac done "$WEB_SERVER_CMD" ${options[@]}; ;; esac } function run_webserver(){ local webserver=$1 set_webserver_options "$WEB_SERVER_CMD" ${options[@]} if [ ! "`is_running`" = true ]; then if [ "`is_running`" = true ]; then do_action_result=success else do_action_result=failed fi else echo "Webserver already running" >&2 fi } function get_cmd(){ local webserver="$1" #First Get the webserver command case "$webserver" in "busybox httpd"|"busybox") if [ $(busybox --list | grep -c httpd) -gt 0 ]; then WEB_SERVER_CMD="busybox httpd" fi; ;; *) if [ ! -z "`which "$webserver"`" ]; then WEB_SERVER_CMD="$webserver" fi; ;; esac #TODO then get the otions for the web server case "$webserver" in *) _p="-p" #The port Number _c="-c" #the option for the configuation file _h="-h" #the option for the webserver root (AKA home directory" esac } function do_action(){ local web_server="$1"; shift local cmd="$1"; shift case "$cmd" in get_cmd) get_cmd "$web_server" if [ -z "$WEB_SERVER_CMD" ]; then do_action_result=failed else do_action_result=success fi; ;; run|run-install) [ -z "$WEB_SERVER_CMD" ] && get_cmd "$web_server" if [ -z "$WEB_SERVER_CMD" ] && [ "$INSTALL_WEBSERVER" = yes ]; then if [ "$cmd" = "run-install" ] || [ "$2" = "install" ]; then pkg --get "$web_server" get_cmd "$web_server" fi fi [ -z "$WEB_SERVER_CMD" ] && run $@ if [ "$(is_running)" = true ]; then do_action_result=success else run_webserver #set_webserver_options #do_action_result=failed fi esac } function do_actions(){ for action in "$@"; do if [ "$1" = get_cmd ] || [ "$1" = run -a "$2" != "install" ]; then web_servers=( "$webserver" "${web_server_fallbacks[@]}" ) else web_servers=( "$webserver" "${web_server_install_fallbacks[@]}" ) fi for a_web_server in "${web_servers[@]}"; do case "$a_web_server" in "busybox httpd"|httpd|busybox) do_action "httpd" "$@"; ;; *) do_action "$a_web_server" "$a_web_server"; ;; esac if [ "$do_action_result" = success ]; then break 2 fi done done } do_actions run install #fi DL_FNAME_Path=${TMPDIR}/${DL_FNAME} rm "$DL_FNAME_Path" DL_DOC_FILE_PATH=${DL_FNAME_Path%"$DL_FILE_EX"} rm "$DL_DOC_FILE_PATH" wget --quiet "$download_url" -O "$DL_FNAME_Path" 1>/dev/null \ || download_failed=true gunzip ${TMPDIR}/${DL_FNAME} AWK_PRG_1=\ 'BEGIN {FS="|"; OFS="|"} { if ($1 ~ /^[^|]+:[^|]+$/ ){ print $1 "|" $2 "|" $3 #We might want to use some of these other fields for a different application }}' if [ "$UPDATE_REPO" = "yes" ]; then export PKG_KEEP_EPOCH_IN_DOC_REPO=true pkg --repo-update fi awk_filter_str='function init_filter(){' function echo_filter_line(){ read a_pkg_name echo "pkg_filter[\""$a_pkg_name"\"]=\"true\"" } filter_lines_path=/tmp/filter_lines rm "$filter_lines_path" while read pkg_record; do #PKG_NAME_ONLY="$(echo "$pkg_record" | cut -f2 -d'|')" #write_filter_line "$PKG_NAME_ONLY" echo "$pkg_record" | cut -f2 -d'|' | echo_filter_line done < <( cat $REPO_DB_DOC_FILE_in | awk "$AWK_PRG_1" ) \ | sort -R | head -n 3 >> "$filter_lines_path" #| tr "\n" " " ) #cat $REPO_DB_DOC_FILE_in | awk "$AWK_PRG" #read -p "Press enter to continue" awk_filter_str="$awk_filter_str $(cat $filter_lines_path)"' } function filter_accept(s){ #Return true if we are to print the result if ( pkg_filter[s] == "true" ){ return "true" } else { return "false" } }' AWK_PRG="$awk_filter_str"' function stripEpoch(s){ sub(/^([0-9]*:)?/,"",s) return s } BEGIN {init_filter()} /^Package:/ { PKG=$0; sub(/^Package: /,"",PKG); FILTER_ACTION=filter_accept(PKG)} #/^Version:/ {VER=$0; sub(/^Package: /,"",VER); {if (FILTER_ACTION == "true"){ print $0 } }' if [ -z "$AWK_PRG_Path_in" ] && [ -z "$AWK_PRG_Path_out" ]; then awk "$AWK_PRG" "$DL_DOC_FILE_PATH" > ${doc_path}/Packages.gz else if [ -z "$AWK_PRG_Path_in" ]; then echo "#!`which gawk` -f" > "$AWK_PRG_Path_out" mkdir -p dirname "$(dirname $AWK_PRG_Path_out)" echo "$AWK_PRG" >> "$AWK_PRG_Path_out" chmod +x "${AWK_PRG_Path_out}" AWK_PRG_Path_in="${AWK_PRG_Path_out}" fi awk -f "$AWK_PRG_Path_in" "$DL_DOC_FILE_PATH" > ${doc_path}/Packages fi gunzip -c "${doc_path}/Packages" > "${doc_path}/Packages.gz" if [ $(pkg --repo-list | grep -c "$repo_name_out") -eq 0 ]; then ( exec <<< "$repo_name_out" pkg --add-repo "$repo_url_out" "$distro_ver_out" "$stream_out" ) fi if [ -z "$(wget --spider -S "http://localhost" 2>&1 | awk '/HTTP\// {print $2}')" ]; then case "$webserver" in *) options=() for option in -p -h -c; do case "$option" in -p) [ ! -z "$PORT" ] && options+=( "$_p" "$PORT" ); ;; -h) [ ! -z "$www_root" ] && options+=( "$_h" "$www_root" ); ;; -c) [ ! -z "$config_file" ] && options+=( "$_c" "$config_file" ); ;; esac done "$WEB_SERVER_CMD" ${options[@]}; ;; esac fi #pkg --repo-update "$repo_name_out"
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
✅✅ Earn 18,000$ Monthly Leaked Guide
JavaScript | 1 min ago | 0.67 KB
⭐⭐ Crypto Swap Glitch ✅ Easy money ⭐⭐
JavaScript | 11 min ago | 0.67 KB
⭐⭐ Free Crypto Method ⭐⭐ ✅
JavaScript | 21 min ago | 0.67 KB
Nano_button_led_hc05
C++ | 29 min ago | 1.50 KB
Infinite Money Glitch
JavaScript | 31 min ago | 0.67 KB
🔥🔥🔥 Swapzone Trading Glitch 🔥🔥🔥
JavaScript | 42 min ago | 0.67 KB
⭐⭐ Instant Money Method ⭐⭐ ✅
JavaScript | 52 min ago | 0.67 KB
VanillaAmmoCraftsRecipes.json
JSON | 1 hour ago | 78.72 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!