Skip to content

Instantly share code, notes, and snippets.

@Omar-Salem
Omar-Salem / commands.sh
Last active March 24, 2025 22:22
PIKVM
#after burning image
echo "WIFI_ESSID='mynet'
WIFI_PASSWD='p@s$$w0rd'">> /Volumes/PIBOOT/pikvm.txt
#! /bin/bash
rw
timedatectl set-timezone Australia/Victoria
passwd root
kvmd-htpasswd set admin
<style>
[data-custom-class='body'], [data-custom-class='body'] * {
background: transparent !important;
}
[data-custom-class='title'], [data-custom-class='title'] * {
font-family: Arial !important;
font-size: 26px !important;
color: #000000 !important;
}
[data-custom-class='subtitle'], [data-custom-class='subtitle'] * {
<style>
[data-custom-class='body'], [data-custom-class='body'] * {
background: transparent !important;
}
[data-custom-class='title'], [data-custom-class='title'] * {
font-family: Arial !important;
font-size: 26px !important;
color: #000000 !important;
}
[data-custom-class='subtitle'], [data-custom-class='subtitle'] * {
import org.springframework.stereotype.Service;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
@Omar-Salem
Omar-Salem / regex.txt
Created January 10, 2021 06:33
Regex to detect N+1 problem in JPA
^Hibernate: select .*\sHibernate: select.*\s
[Unit]
Description=Bamboo systemd service.
[Service]
Type=simple
ExecStart=/root/bamboo/bin/start-bamboo.sh -fg
[Install]
WantedBy=multi-user.target
@Omar-Salem
Omar-Salem / flatemates.py
Last active April 20, 2019 02:51
flatemates crawler/filtere
import json
from haversine import haversine
import urllib2
from bs4 import BeautifulSoup
def read_data():
with open('data.json', 'r') as data:
return data.read()
def filter_data(data):
#!/bin/bash
# remove all containers and images
docker stop $(docker ps -a -q) && docker rm -f $(docker ps -a -q) && docker rmi -f $(docker images -q)
#build and run
docker build -t gameel-services .
docker run -p 8080:8080 gameel-services
@Omar-Salem
Omar-Salem / gist:97e0b8bdb618154d3a0c14d7f02e9436
Last active June 8, 2018 00:16
find process using port and kill
kill $(lsof -t -i:{port})
sudo keytool -import -v -trustcacerts -alias charles -file /Users/omars/Downloads/charles-proxy-ssl-proxying-certificate.pem -keystore cacerts.jks -keypass changeit -storepass changeit