Skip to content

Instantly share code, notes, and snippets.

View tayyebi's full-sized avatar
📿
Grateful

MohammadReza Tayyebi tayyebi

📿
Grateful
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tayyebi on github.
  • I am tayyebi (https://keybase.io/tayyebi) on keybase.
  • I have a public key ASA9Gt9l1wkhs97cpQws31WA9eehUEX_i-EN56y6nTstuwo

To claim this, I am signing this object:

def factorial(n): # n!
r = 1
i = 2
while i <= n:
r *= i
i += 1
return r
def P(n, r): # n! / (n-r)!
return factorial ( n ) / factorial ( n - r )
<?php // Checksum: 5173f2c74dab371d015ba84ce4b9a343 ?>
<?php
// Implementation by https://github.com/tayyebi
// Based on a talk by https://bendechrai.com/
// VIRUS:START
error_reporting(0);
@tayyebi
tayyebi / 8queens.cpp
Last active September 14, 2022 15:48
Solution to "8 Queens" problem, Genetics Algorithm
/*
* A GENETIC SOLUTION TO 8 QUEENS
* COMPUTATIONAL INTELLIGENCE COURSE
* BU-ALI SINA UNIVERSITY 2019
*
* DEVELOPER: MOHAMMAD R. TAYYEBI, B.SC.
* SUPERVISOR: MOHAMMAD BAMNESHIN
*
* =======================
* WARNING WARNING WARNING
@tayyebi
tayyebi / apt-get LaTeX IEEE.sh
Last active January 25, 2020 07:34
apt-get offile installation
# Get list of texstudio files
sudo apt-add-repository ppa:blahota/texstudio
sudo apt-get update
sudo apt-get --print-uris --yes install texstudio | grep ^\' | cut -d\' -f2 > latex.txt
# Install XeLaTex
sudo apt-get --print-uris --yes install texlive-xetex | grep ^\' | cut -d\' -f2 > latex.txt
# Get list of fonts
@tayyebi
tayyebi / from-guest.sh
Created February 24, 2020 08:06 — forked from anshumanb/from-guest.sh
Disable and enable VirtualBox guest-host time sync
# Disable time sync from guest
/etc/init.d/vboxadd-service stop
# Enable time sync from guest
/etc/init.d/vboxadd-service start
# Command line notes of ArvanCloud.com Paas cli
# until this moment, there isn't a reliable documentation for ArvanCloud PaaS
# this is based on experiments
# Download Arvan CLI
wget https://napi.arvancloud.com/paas/v1/regions/ir-thr-mn1/downloads/cli/linux/arvan
# Move it to /opt
mv arvan /opt
@tayyebi
tayyebi / ProjectWebcam.sh
Created March 2, 2020 08:09
Use mplayer to project WebCam on screen
# Install mplayer
sudo apt install mplayer
# Enjoy :)
mplayer tv:// -tv driver=v4l2:width=320:height=240 - vo xv
@tayyebi
tayyebi / TelegramEmailSync.js
Created March 2, 2020 08:19
Sync Telegram and Email using Google Apps Script
function myFunction() {
var bot_token = "1097946362:AAFIqSpcWaQto-JGSGIn4gi7RriuWUtqb30";
var base_url = "https://api.telegram.org/bot" + bot_token + "/";
// Open spreadsheet
var FileNameString = "TelegramBot";
var FileIterator = DriveApp.getFilesByName(FileNameString);
while (FileIterator.hasNext())
## Instructions From: https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost
Open & Edit /etc/my.cnf or /etc/mysql/my.cnf, depending on your distro.
Add skip-grant-tables under [mysqld]
Restart Mysql
You should be able to login to mysql now using the below command mysql -u root -p
Run mysql> flush privileges;
Set new password by ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
Go back to /etc/my.cnf and remove/comment skip-grant-tables