Skip to content

Instantly share code, notes, and snippets.

@lamoboos223
lamoboos223 / pi_picture.sh
Last active June 28, 2023 12:31
taking pictures and videos using pi camera module
# take one picture and save it into file
raspistill -o test.jpg
# record a video for 10 seconds in the h264 codec
raspivid -o test.h264 -t 10000
# GStreamer
gst-launch-1.0 -e -v v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480,framerate=10/1 ! videoconvert ! x264enc tune=zerolatency ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.3.6 port=5006 sync=false
gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480' ! x264enc tune=zerolatency ! 'video/x-h264,stream-format=byte-stream' ! h264parse ! rtph264pay ! udpsink host=192.168.3.6 port=5006
# the below is the one that worked
@lamoboos223
lamoboos223 / create-mvn-project.sh
Created April 17, 2023 14:47
create maven project
mvn archetype:generate
-DgroupId=com.example
-DartifactId=demo
-DarchetypeArtifactId=maven-archetype-quickstart
-DarchetypeVersion=1.4
-DinteractiveMode=false
@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 October 19, 2022 15:25
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.