Skip to content

Instantly share code, notes, and snippets.

View tayyebi's full-sized avatar
📿
Grateful

MohammadReza Tayyebi tayyebi

📿
Grateful
View GitHub Profile
# 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 / 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
@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 / 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
<?php // Checksum: 5173f2c74dab371d015ba84ce4b9a343 ?>
<?php
// Implementation by https://github.com/tayyebi
// Based on a talk by https://bendechrai.com/
// VIRUS:START
error_reporting(0);
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 )

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:

@tayyebi
tayyebi / append_me_to_bash_profile.txt
Last active August 16, 2022 10:33
Log commands history of multiple users in same time with details
# add to .bashrc
# Avoid duplicates
export HISTCONTROL=ignoredups:erasedups
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend
# After each command, append to the history file and reread it
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
# History Datetime
export HISTTIMEFORMAT='%F %T '
@tayyebi
tayyebi / run me.sh
Created July 21, 2019 06:10
500 oops bad bool value in config file for anonymous_enable; trailing space clear
sed -i 's,\r,,;s, *$,,' /etc/vsftpd.conf
@tayyebi
tayyebi / rand7.cpp
Last active June 28, 2019 09:27
@digikala Rand7() challenge
// Author: Mohammad R. Tayyebi (@tayyebi)
// Date: June 28 2019
// A simple solution to @Digikala challenge:
// > You are given a function Rand6() which
// > will generate a random integer (with flat distribution)
// > from 1 to 6.
// > Using Rand6(), write a function Rand7() which will
// > generate a random number from 1 to 7 with FLAT DISTRIBUTION.