Skip to content

Instantly share code, notes, and snippets.

View malohtie's full-sized avatar

Mohamed Amine EL ATTABI malohtie

View GitHub Profile
@malohtie
malohtie / dropbox-php-auth.md
Created June 9, 2022 09:01 — forked from phuze/dropbox-php-auth.md
Dropbox API V2: PHP Authentication Process

Effective September 2021, Dropbox will be deprecating long-lived access tokens.

This GIST generally describes how to authenticate requests to Dropbox API v2, for anyone working on a server-side PHP Dropbox implementation.

It's important to understand three types of codes you'll encounter:

  1. Access Code - this is a one-time code that represents user-granted app access.
  2. Access Token - this is short-lived token that provides access to Dropbox API endpoints.
  3. Refresh Token - this is a long-lived token that allows you to fetch a fresh Access Token.
@malohtie
malohtie / firewalld.md
Created February 16, 2022 11:10 — forked from frengky/firewalld.md
FirewallD command line snippets for Linux

FirewallD command line snippets for Linux

Create new zone identified by an IP Address or interface This 'example' zone rules will applied to the connection from 192.168.1.2

  $ firewall-cmd --list-all-zones
  $ firewall-cmd --permanent --new-zone=example
  $ firewall-cmd --permanent --zone=example --add-source=192.168.1.2
  $ firewall-cmd --zone=example --list-sources
@malohtie
malohtie / ssh
Last active July 3, 2019 14:50
Enable password login to your ssh server (redhat)
#!/bin/bash
sed -i 's/#Port 22/Port 22/g' /etc/ssh/sshd_config;
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sed -i 's/PermitRootLogin without-password/#PermitRootLogin without-password/g' /etc/ssh/sshd_config;
echo root:yourpassword | chpasswd;
service sshd restart;
<?php
/* ---------------------------------------------------------- */
/* minibots.class.php Ver.1.9g */
/* ---------------------------------------------------------- */
/* Mini Bots class is a small php class that allows you to */
/* use some free web seriveces online to retrive usefull data */
/* and infos. This version includes: */
/* smtp validation, check spelling, meteo, exchange rates, */
/* shorten urls, and geo referencing with IP address and more */
/* Feel free to use in your applications, but link my blog: */