Skip to content

Instantly share code, notes, and snippets.

View mohammedhanine's full-sized avatar

Mohammed Hanine mohammedhanine

View GitHub Profile
@mohammedhanine
mohammedhanine / nginx-ps-config
Created September 22, 2017 21:37 — forked from ASergey/nginx-ps-config
Example prestashop 1.6 nginx host config
server {
listen 80;
server_name maxmobiles.lo *.maxmobiles.lo;
root /var/www/maxmobiles.lo;
error_log /var/www/maxmobiles.lo/log/error.log warn;
location / {
index index.html index.php; ## Allow a static html file to be shown first
String readString;
void setup()
{
Serial.begin(115200);
delay(200);
Serial.println("AT");
delay(1000);
Serial.println("AT+CREG=0");
void setup()
{
Serial.begin(115200);
delay(200);
Serial.println("AT");
delay(1000);
Serial.print("AT+CREG=0");
delay(2000);
Serial.print("AT+CGATT=1");
delay(2000);
@mohammedhanine
mohammedhanine / index.html
Created July 28, 2016 09:38
Cookie Console Prompt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<style>
/* - cookies-notify */
@mohammedhanine
mohammedhanine / RemovePin
Created September 28, 2014 16:57
Remove Pin Python
#!/usr/bin/env python
"""\
pip install python-gsmmodem
"""
import logging
PORT = '/dev/ttyUSB1'
BAUDRATE = 115200
@mohammedhanine
mohammedhanine / firewall
Last active October 3, 2021 13:12
firewall iptables OVH por pais
#!/bin/bash
#authorized countries
ISO="es ma"
### PATH ###
IPT=/sbin/iptables
WGET=/usr/bin/wget
EGREP=/bin/egrep
#!/bin/bash
#
#-----------------------------------#
# Para añadir una copia de seguridad a la lista hay que añadir
# - DIRS la ruta de backup
# - NDIRS el nombre de backup
# - DDBB el nombre de base de datos
#-----------------------------------#
#!/bin/bash
#version : 1.1
### Local ###
BACKUP="backup"
### Datos POSTGRESQL ###
MDB="DB_name"
MUSER="user_postgres"
MPASS="pass_postgres"
MHOST="host_postgres"
#!/usr/bin/perl
$_MODEM="/dev/ttyUSB1";
use Device::Modem;
my $modem = new Device::Modem( port => $_MODEM );
if ( $modem->connect( baudrate => 115200 ) ) {
$modem->echo(1);
$modem->verbose(1);
$modem->atsend( 'AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0'.Device::Modem::CR);
print $modem->answer()."\n";
$modem->atsend( 'AT+CPIN="'.$ARGV[0].'"'.Device::Modem::CR);
#!/usr/bin/perl
$_SMS_CM="+34607003110";
#$_SMS_MODEM="/dev/ttyACM0";
$_SMS_MODEM="/dev/ttyUSB1";
if ($#ARGV != 1 ) {
print "Uso:\n";
print " ./sendsms.perl 444444444 \"text\"\n\n";
exit;
}
use Device::Modem;