Skip to content

Instantly share code, notes, and snippets.

@lamoboos223
lamoboos223 / drupal.sh
Last active March 1, 2023 14:21
prepare drupal vm
# installing all the required components to run drupal
apt-get install composer
apt-get install php8.2.0
apt-get install apache2
apt-get install mysql
# creating new drupal project using the latest recommended version
composer create-project drupal/recommended-project demo1
# installing drush via composer
composer require --dev drush/drush
./vendor/bin/drush --version
@lamoboos223
lamoboos223 / packages.txt
Last active February 2, 2023 16:35
system packages
git
curl
python3
default-jdk
ansible
tomcat9 tomcat9-admin
@lamoboos223
lamoboos223 / install_keycloak_standalone_16.1.1.sh
Last active March 5, 2023 13:34
script to install and configure keycloak as a service
curl -s https://raw.githubusercontent.com/lamoboos223/general/main/lama-logo.sh | bash
sudo yum update
# TODO: make sure the OpenJDK is 11 and set JAVA_HOME env var
# TODO: change this line handler.FILE.fileName=C\:\\development\\keycloak-16.1.1\\standalone\\log\\server.log in C:\development\keycloak-16.1.1\standalone\configuration\logging.properties
# sudo apt-get install default-jdk -y
sudo yum-repository ppa:openjdk-r/ppa
sudo yum update
sudo yum install openjdk-11-jdk
cd /opt
# Get public ip address
ip=$(curl https://api.ipify.org)
# Update noip dns using the public ip address
curl --location --request GET 'https://dynupdate.no-ip.com/nic/update?hostname=<my-dns-in-noip>&myip=$ip' \
--header 'Authorization: Basic <email:password>'
# backup SD card to image named backup-25-10-2019.dmg
sudo dd if=/dev/disk2 of=~/backup-25-10-2019.dmg bs=4m
# burn backup image to SD card
sudo dd if=~/backup-25-10-2019.dmg of=/dev/disk2 bs=4m
cat << "EOF"
_ ____ _____
| | / __ \ / ____|
| | __ _ _ __ ___ __ _ | | | | (___
| | / _\ | '_ ` _ \ / _` | | | | |\___ \ Lama Alosaimi ❤️
| |___| (_| | | | | | | (_| | | |__| |____) | Linkedin 👉🏻 https://www.linkedin.com/in/lama-alosaimi
|______\__,_|_| |_| |_|\__,_| \____/|_____/ Medium 👉🏻 https://medium.com/@lalosaimi
_,.
,` -.)
'( _/'-\\-.
@lamoboos223
lamoboos223 / publish_to_pypi.sh
Last active December 10, 2024 15:21
Upload package to PyPi and PyPi Test
#!/bin/sh
rm setup.py
rm -rf *.egg.info build/ dist/
curl -s https://raw.githubusercontent.com/lamoboos223/general/main/lama-logo.sh | bash
echo "Creating setup.py file, please submit the package info below."
echo "Library Name (will be displayed on the pypi)?"
read name
@lamoboos223
lamoboos223 / readme.md
Created October 12, 2022 13:42 — forked from anthonyray/readme.md
Setting up OhMyZsh on a rapsberry Pi
  1. Connect to your raspberry Pi with SSH
  2. Install zsh : sudo apt-get update && sudo apt-get install zsh
  3. Edit your passwd configuration file to tell which shell to use for user pi : sudo vim /etc/passwd and change /bin/bash and /bin/zsh
  4. Reconnect to your raspberry, and check that zsh is the shell with echo $0.
  5. Switch to root : sudo su
  6. Install OhMyZsh : sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  7. Disconnect from your instance and reconnect it.
echo "hello world"
frontend http
bind *:80
timeout client 60s
mode http
acl app1 path_end -i /app1
acl app2 path_end -i /app2
use_backend demo-app1 if app1
use_backend demo-app2 if app2
default_backend demo-apps