Skip to content

Instantly share code, notes, and snippets.

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

NetPlayer netplayer

🏠
Working from home
View GitHub Profile
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
@netplayer
netplayer / prestashop-lib.php
Created October 2, 2018 02:07 — forked from matchaxnb/prestashop-lib.php
Library to manipulate Prestashop from scripts
<?php
/**
prestashop-lib — © 2015 Chloé Tigre Rouge <chloe@tigres-rouges.net>
This is licensed under the same terms as Prestashop.
PrestaShop library to create products, categories and all sorts of things
programmatically by passing arrays around
It needs a bootstrapped PrestaShop framework (you can get one by defining
_PS_ROOT_DIR_ and by a
require_once(_PS_ROOT_DIR_.'config/config.inc.php');
var dt_to = $.datepicker.formatDate('dd-mm-yy', new Date());
date("d-m-Y H:i:s",strtotime($myactivity['date']));
### Keybase proof
I hereby claim:
* I am netplayer on github.
* I am netplayer (https://keybase.io/netplayer) on keybase.
* I have a public key ASAVnNO_L9HRhfadPpYXLtG6d9mmWj4C6sS2dOeFgSnb9go
To claim this, I am signing this object:
@netplayer
netplayer / create mysql user
Last active December 12, 2018 22:43
create mysql user
sudo mysql --user=root mysql
2. Create a user for phpMyAdmin
Run the following commands (replacing some_pass by the desired password):
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
CREDITS: [link](https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7/763359#763359)
@netplayer
netplayer / gist:4fb1defb5464eee7dc7e5a81ac1678af
Last active February 22, 2025 19:10
disable php5 enable php7
Interactive switching mode
---------------------------
sudo update-alternatives --config php
Manual Switching
----------------=
sudo a2dismod php5
sudo a2enmod php7.0
rsync -avpzn --progress --exclude <pattern> <source> <user>@<host>:<destination>
-a archive
-v verbose
-p preserve permissions
-z compress on transfer
@netplayer
netplayer / gist:a880de2b89a592859993aa0c47878d1e
Last active June 20, 2025 10:29
Firewalld - block ip's F I R E W A L L --------------------------------------- F I R E W A L L ------------------------------------
FOR SINGLE IP:
firewall-cmd --permanent --zone=drop --add-rich-rule="rule family='ipv4' source address='xxx.xxx.xxx.xxx' reject"
firewall-cmd --reload
FOR RANGE AND BULK:
SETUP:
The Firewalld way:

Keybase proof

I hereby claim:

  • I am netplayer on github.
  • I am netplayer (https://keybase.io/netplayer) on keybase.
  • I have a public key ASB1dDYP19w43IxtdYIinDPJp9bghnxgOmi_xuM5aiQIjAo

To claim this, I am signing this object: