Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
#!/bin/bash set -e # specs for virtual machine declare -A VMACHINE=( [RAM]=4g [CPU]=2 ) # you can override them by redifining them in this file [ -e specs.sh ] && source ./specs.sh echo all files in skel will be copied in /home/user touch skel function require () { which $1 &> /dev/null && echo "$1 OK" || ( echo "ARG: You SHOULD install $1 $@"; exit 1; ) } echo CHECKING require growisofs require qemu-img package qemu system require curl LOCATION=$(pwd) ARCH=${ARCH:-amd64} VERSION=${VERSION:-14.2} FLAVOUR=${FLAVOUR:-RELEASE} FROM_VM=https://download.freebsd.org/ftp/releases/VM-IMAGES/${VERSION}-${FLAVOUR}/${ARCH}/Latest/ FROM_CDROM=https://download.freebsd.org/ftp/releases/ISO-IMAGES/${VERSION}/ FILENAME=FreeBSD-${VERSION}-${FLAVOUR}-${ARCH}.qcow2 CDROM="$( basename $FILENAME .qcow2 )-bootonly.iso" BUILD=${LOCATION}/build read -p "Enter a password for root & user\n# " -s PASSWORD echo [ -f $CDROM ] || curl "$FROM_CDROM/${CDROM}" > "$CDROM" [ -f ${FILENAME}.bak ] ||( curl $FROM_VM/${FILENAME}.xz | xz -d - > ${FILENAME}.bak; ) KEYMAP="fr" BUILD=${LOCATION}/build SKEL=${LOCATION}/skel BUILD_ETC=${LOCATION}/build/etc echo new fresh ISO cp $LOCATION/$CDROM $LOCATION/new.iso cp $LOCATION/$CDROM $LOCATION/new2.iso echo creating build dir rm -rf "$BUILD" mkdir "$BUILD" mkdir "$BUILD/etc" mkdir "$BUILD/boot" [ -d $SKEL ] || (mkdir "$SKEL" && touch "$SKELL/killroy_was_here") echo new fresh qcow2 # using qemu-nbd snapshot here could be smart but I hate their doc cp $LOCATION/$FILENAME.bak $LOCATION/${FILENAME} echo creating /etc/rc.conf cat > $BUILD/etc/rc.conf << EIA keymap="$KEYMAP" firstboot_freebsd_update_enable=YES growfs_enable=YES dumpdev="AUTO" EIA cat > $BUILD/boot/loader.conf << \EOA dcons_load="YES" boot_multicons="YES" boot_serial="YES" console="comconsole" EOA echo creating /boot/loader.conf echo creating /ect/installerconfig to executes custom code cat > $BUILD/etc/installerconfig << \EOG #!/bin/sh echo Resizing ROOTFS_VM=/dev/ada0p4 JAILFS_VM=/dev/ada0p5 camcontrol reprobe /dev/ada0 echo repairaing the size extension made with qemuimg gpart recover ada0 gpart resize -i 4 /dev/ada0 growfs -y $ROOTFS_VM echo adding zfs partition #gpart add -t freebsd-zfs -a 4k -s 1500M ada0 gpart recover ada0 poweroff EOG chmod +x $BUILD_ETC/installerconfig echo building the new CD image with new layer including installerconfig volid=$(isoinfo -d -i new.iso | awk '/Volume id/{print$3}') growisofs -M new.iso -d -l -r -V "$volid" -graft-points /etc/rc.conf=$BUILD/etc/rc.conf /etc/installerconfig=$BUILD/etc/installerconfig echo resizing VM qemu size qemu-img resize $LOCATION/$FILENAME +5000M echo bootsrtapping qemu image with growfs qemu-system-x86_64 -m ${VMACHINE[RAM]} -smp ${VMACHINE[CPU]} -cdrom new.iso -boot order=d -drive file=${LOCATION}/${FILENAME} echo creating another cdrom ROOTFS_VM=/dev/ada0p4 cat > $BUILD/etc/installerconfig << EOJ #!/bin/sh echo Custom Install 2 set -x echo doing manipulation on the host with a chroot #read -p "debugging the install by launching a promptless shell" TEST #sh mount -t tmpfs -o size=1624m tmpfs /tmp #fsck -y $ROOTFS_VM mount $ROOTFS_VM /mnt echo changing rc.conf on the mounted VM cp /etc/rc.conf /mnt/etc/rc.conf echo changing boot/loader on the mounted VM cp /boot/loader.conf.template /mnt/boot/loader.conf cp -a /skel /mnt/tmp #echo setting up ZFS >> /etc/motd.template #service zfs start #zpool create jails /dev/ada0p5 cat << 'EOP' | chroot /mnt /bin/sh mount -t devfs devfs /dev echo 'ifconfig_em0="DHCP"' >> /etc/rc.conf echo setting up network interfaxce >> /etc/motd.template service netif restart echo fixing my broken local dnsmaq using 1.1.1.1 echo making 1.1.1.1 the first dns server echo 'prepend domain-name-servers 1.1.1.1;' > /etc/dhclient.conf dhclient em0 ifconfig em0 netstat -nr sysrc sshd_enabled="YES" echo ssh automatically starting >> /etc/motd.template pkg install -y python310 echo installing pip for python3.10 >> /etc/motd.template echo use ports to have latest python current >> /etc/motd.template python3.10 -mensurepip pkg install -y git echo installing doas and setting user as a root user without pass >> /etc/motd.template pkg install -y doas echo "permit nopass user as root" > /usr/local/etc/doas.conf sync sleep 5 #portsnap --interactive fetch #portsnap --interactive extract #portsnap --interactive update #sysrc console="comsonsole" EOJ cat >> $BUILD/etc/installerconfig << EOQ #echo bash c installed >> /etc/motd.template sleep 5 echo 'export TERM=vt100-color' >> /usr/local/etc/profile echo setting up hostname >> /etc/motd.template echo 'hostname="freebsd-${VERSION}_${FLAVOUR}"' >> /etc/rc.conf sync sleep 5 echo -n '$PASSWORD' | pw useradd -n user -m -G wheel -h 0 echo copying user file in user dir >> /etc/motd.template chown -R user:user /tmp/skel/* echo setting up hostname >> /etc/motd.template cp -a /tmp/skel/* /home/user cp -a /tmp/skel/.[^.]* /home/user rm -rf /tmp/skel sync sleep 5 echo importing user files >> /etc/motd.template echo -n '$PASSWORD' | pw usermod root -h 0 echo setting up pwd >> /etc/motd.template chsh -s /usr/local/bin/bash root sync sleep 5 echo setting up pwd >> /etc/motd.template pkg install -y bash bash-completion echo installing podman pkg install -y podman-suite pkg install -y podman echo https://podman.io/docs/installation >> /etc/motd.template sync sleep 5 ##### BUG WAS THERE ########## echo "fdesc /dev/fd fdescfs rw 0 0" >> /etc/fstab service podman enable cp /usr/local/etc/containers/pf.conf.sample /etc/pf.conf echo mod pf >> /etc/motd.template sync perl -pe 's/v4egress_if.*/v4egress_if="em0"/' /etc/pf.conf perl -pe 's/v6egress_if.*/v6egress_if="em0"/' /etc/pf.conf echo enabling pf >> /etc/motd.template service pf enable echo 'pf_load="YES"' >> /boot/loader.conf echo 'net.pf.filter_local=1' >> /etc/sysctl.conf.local sync sleep 5 echo changing storage to vfs >> /etc/motd.template sed -I .bak -e 's/driver = "zfs"/driver = "vfs"/' /usr/local/etc/containers/storage.conf sysrc linux_enable=YES echo https://github.com/containers/podman/blob/main/troubleshooting.md >> /etc/motd.template echo 'unqualified-search-registries = ["docker.io", "registry.fedoraproject.org", "quay.io", "registry.access.redhat.com"]' >> /etc/containers/registries.conf echo setting up hostname >> /etc/motd.template sync sleep 5 chsh -s /usr/local/bin/bash user EOP echo emitting power off to avoir hanigup sync sleep 5 poweroff EOQ chmod +x $BUILD/etc/installerconfig echo building the new iso with new layer volid=$(isoinfo -d -i new2.iso | awk '/Volume id/{print$3}') growisofs -M new2.iso -input-charset=utf8 -d -l -r -V "$volid" -graft-points /etc/rc.conf=$BUILD/etc/rc.conf /etc/installerconfig=$BUILD/etc/installerconfig /boot/loader.conf.template=$BUILD/boot/loader.conf /skel=$SKEL qemu-system-x86_64 -m ${VMACHINE[RAM]} -smp ${VMACHINE[CPU]} -cdrom new2.iso -boot order=d -drive file=${LOCATION}/${FILENAME} echo booting the image echo creating ./start_${VERSION}_${FLAVOUR}.sh for later convenience echo qemu-system-x86_64 -m ${VMACHINE[RAM]} -smp ${VMACHINE[CPU]} -nographic ${LOCATION}/${FILENAME} \$\* > ./start_${VERSION}_${FLAVOUR}.sh chmod +x ./start_${VERSION}_${FLAVOUR}.sh ./start_${VERSION}_${FLAVOUR}.sh
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
✅ Make $2500 in 15 minutes
JavaScript | 3 sec ago | 0.25 KB
⭐ MAKE $2500 IN 15 MIN ⭐
JavaScript | 6 sec ago | 0.25 KB
⭐⭐⭐Exchange Exploit T 2⭐⭐⭐
Java | 6 sec ago | 0.06 KB
⭐ Trading Profit Method ⭐
JavaScript | 14 sec ago | 0.25 KB
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐⭐
Java | 17 sec ago | 0.06 KB
⭐ChangeNOW Bug (Get more on BTC swaps)
JavaScript | 23 sec ago | 0.25 KB
✅ Make huge profits on trading
JavaScript | 25 sec ago | 0.25 KB
⭐⭐⭐Instant Profit Method⭐⭐⭐
Java | 28 sec ago | 0.06 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!