Interesting useful stuff.
Sorry, Oracle users, but I sometimes forget how to create a user on Oracle databases. Last day, I needed to set up an Oracle 21XE test environment. I just discovered this Vagrant official images space. So, after cloning that repo, navigate to the OracleDatabase
directory and then to the 21.3.0-XE
directory and start the vagrant with vagrant up
; this will take many minutes to complete, so, at the end, enter the Vagrant using the vagrant ssh
command.
Now, follow this in the Oracle Vagrant virtual machine:
sudo su -
su - oracle
sqlplus / as sysdba
alter session set "_ORACLE_SCRIPT"=true;
CREATE USER username IDENTIFIED BY password;
GRANT CONNECT, RESOURCE, DBA TO username;
That's it. Now we have a 100% funcional Oracle DB running in our localhost (port 1521).
A lot of years ago I used a similar script to share the Wi-Fi Internet connection from a Debian-based old Netbook (tough days, I know) to my main wired box (an AMD FX-based box with Slackware Linux 14). The Netbook receives the Internet from a Wi-Fi card and shares that connectivity via an Ethernet NIC in a separate internal network.
Guess what, I'm still dealing with the same problem today: I have a Raspberry Pi 3b+ running FreeBSD 13.2, which doesn't support native Wi-Fi hardware. I had two choices: 1) Wipe the SD card and install a Linux distribution (bruh...), 2) connect the Raspberry Pi 3b+ directly to the router, or 3) recall how I fixed this issue previously.
Let's follow the hardest way:
┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐
│ │ │ │ │ │
│ wi-fi router │ │ bergelmir │ │ rhea │
│ ├───┬───► ├───┬───► │
│ │ │ │ wlan0 eth0 │ │ │ ue0 │
└─────────────────┘ │ └─────────────────┘ │ └────────────────┘
│ │
▼ ▼
wi-fi net wired net
192.168.1.X 10.0.0.X
This script does the magic after connecting two boxes with an ethernet cable:
#!/bin/bash
# the eth0 interface is the raspberry pi 3b+ gateway
ip addr add 10.0.0.1/24 dev eth0
# share from wlan0 to eth0
iptables -A FORWARD -o wlan0 -i eth0 -s 10.0.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
# show the route table
route -n
# all done.
Note: The FreeBSD box must be configured as follows:
bsdconfig
command as the root
user.ue0
in my case), then set DHCP to "Disabled," "ipaddr" to 10.0.0.10
and "netmask" to 255.255.255.0
. Exit.10.0.0.1
before saving. Exit.8.8.8.8
. Exitbsdconfig
utility.Welcome to the family rhea.
I love all related to automation and usually, I have multiple versions of Rundeck installed on my computer for testing. So, the following scripts allow you to run any Rundeck version, the requirement is to save every war file in a folder named with the version number. In that way, you can provide the Rundeck version as an argument.
The launcher.sh
script:
#!/bin/bash
cat <<EOF
Usage: $0 rundeck_version_number
Example: $0 4.17.2
EOF
if [ $# -eq 0 ]
then
echo "No Rundeck version supplied"
else
cd $1
java -jar -server -Xmx4096m -Xms1024m -Drundeck.jaaslogin=true -Dserver.servlet.session.timeout=300 rundeck-$1-*.war
fi
# all done.
cleaner.sh
:
#!/bin/bash
cat <<EOF
Usage: $0 rundeck_version_number
Example: $0 4.17.2
EOF
if [ $# -eq 0 ]
then
echo "No Rundeck version supplied"
else
cd $1
rm -rf etc/ libext/ projects/ repository/ server/ user-assets/ var/
fi
# all done.
Enjoy.