Skip to content

Instantly share code, notes, and snippets.

View MahefaAbel's full-sized avatar
🏠
Working from home

Mahefa Abel MahefaAbel

🏠
Working from home
View GitHub Profile
@MahefaAbel
MahefaAbel / generate-ios.sh
Created January 24, 2023 12:43 — forked from monmonja/generate-ios.sh
generate ios from command line
# download this file to your project folder and excute
# chmod +x generate-ios.sh
# then run using
# ./generate-ios.sh
# flutter build defaults to --release
flutter build ios
# make folder, add .app then zip it and rename it to .ipa
mkdir -p Payload
wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
sudo apt update
sudo apt-cache policy mysql-server
sudo apt install -f mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7*
@MahefaAbel
MahefaAbel / start-new-instance-chrome.sh
Created May 9, 2022 07:24
start-new-instance-chrome
mkdir /tmp/chrome2
google-chrome --user-data-dir=/tmp/chrome2/
@MahefaAbel
MahefaAbel / install-phpmyadmin.sh
Last active May 9, 2022 07:14
install-phpmyadmin
wget https://files.phpmyadmin.net/phpMyAdmin/4.9.10/phpMyAdmin-4.9.10-all-languages.zip
unzip phpMyAdmin-4.9.10-all-languages.zip
sudo mv phpMyAdmin-4.9.10-all-languages/ /usr/share/phpmyadmin
sudo mkdir -p /var/lib/phpmyadmin/tmp
sudo chown -R www-data:www-data /var/lib/phpmyadmin
sudo mkdir /etc/phpmyadmin/
sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
@MahefaAbel
MahefaAbel / switch-php.sh
Last active May 9, 2022 07:02
Switch php
sudo a2dismod php5.6
sudo a2dismod php7.0
sudo a2enmod php7.2
sudo update-alternatives --set php /usr/bin/php7.2
sudo update-alternatives --set phar /usr/bin/phar7.2
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.2
# sudo update-alternatives --set phpize /usr/bin/phpize7.2
# sudo update-alternatives --set php-config /usr/bin/php-config7.2
@MahefaAbel
MahefaAbel / chroot-predator.sh
Last active February 6, 2023 11:52
Chroot Predator + Bootable manipulation Grub + Graphic Driver
mount /dev/sdb5 /mnt
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --bind /boot /mnt/boot
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
for dir in proc dev sys etc bin sbin var usr lib lib64 tmp; do
# mkdir /mnt/$dir && \
@MahefaAbel
MahefaAbel / FirebaseMessaging-Flutter.dart
Created March 17, 2022 08:51
Firebase Cloud Messaging for Flutter
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
_firebaseMessaging.configure(
onLaunch: (Map<String, dynamic> message) {
print('onLaunch called');
},
onResume: (Map<String, dynamic> message) {
print('onResume called');
},
onMessage: (Map<String, dynamic> message) {
print('onMessage called');
@MahefaAbel
MahefaAbel / SQL requette - myteknow RG.sql
Created February 25, 2022 07:24
SQL requette - myteknow
-- ----------------------------------------------------------------
DROP FUNCTION IF EXISTS getIdEntrepriseFromPrestation; DELIMITER //
CREATE FUNCTION getIdEntrepriseFromPrestation(id_post_prestation INT) RETURNS INT BEGIN
DECLARE idEntreprise INT;
SELECT pm.meta_value INTO idEntreprise FROM wp_612371_postmeta pm INNER JOIN wp_612371_posts p ON p.ID=pm.post_id
WHERE p.post_type = "prestation" AND pm.meta_key = "Entreprise" AND p.ID=id_post_prestation;
RETURN idEntreprise;
END // DELIMITER ;
SELECT getIdEntrepriseFromPrestation(74511);
@MahefaAbel
MahefaAbel / override-default-charset.sh
Last active February 8, 2022 08:13
Java Charseting
Can We Override the Default Charset?
-Dfile.encoding="UTF-8"
-Dsun.jnu.encoding="UTF-8"
java -Dfile.encoding=utf-8 -jar target\application.jar