Skip to content

Instantly share code, notes, and snippets.

View tayyebi's full-sized avatar
📿
Grateful

MohammadReza Tayyebi tayyebi

📿
Grateful
View GitHub Profile
@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.
@tayyebi
tayyebi / linkedin-connect.js
Created June 18, 2019 06:56
LinkedIn Connect Snippet with Custom Message
var text= `Hello.
This is Reza, former WorldSkills Competitor and Khwarizmi Award winner.
It's an honor to connect with you here on Linkedin.com.
Best regards,
Tayyebi.`;
$('.pv-s-profile-actions--connect').click();
@tayyebi
tayyebi / hacker.py
Created June 8, 2019 15:04
Remote Terminal with Python
import socket
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('192.168.0.111', 8080))
while True:
command = raw_input("Enter command> ")
client.send(command)
from_server = client.recv(4096)
print (from_server)
client.close()
sudo chmod -R 755 /var/www/html/Site
sudo chown -R www-data: /var/www/html/Site
#include<iostream>
using namespace std;
#define a int
#define b main
#define c (
#define d )
#define e {
#define much cout
#define you <<
@tayyebi
tayyebi / python-agent-login.py
Created March 10, 2019 13:49
Python fake browser
import requests
payload = {
'Username': 'tayyebi',
'Password': '123',
'Login': '',
}
with requests.Session() as s:
p = s.post('http://sariab.pressz.ir/ajax/log/in', data=payload)
@tayyebi
tayyebi / misery_loop.py
Created March 9, 2019 12:12
busy loop in python using lambda
a = [True, True, True, False, True, True]
X = lambda n : a[n] if n < 1 else X(n-1) and a[n]
def explore ():
print ('hi')
while X(len(a) - 1):
continue
explore()
explore()
@tayyebi
tayyebi / note.txt
Last active July 27, 2020 03:32
Trim and rotate videos for Instagram IGTV
Trim
> https://www.ostechnix.com/20-ffmpeg-commands-beginners/
$ ffmpeg -i input.mp4 -ss 00:00:00 -codec copy -t 600 output.mp4
Rotate
> https://stackoverflow.com/questions/3937387
$ ffmpeg -i input.mp4 -metadata:s:v rotate="-90" -codec copy output.mp4
@tayyebi
tayyebi / Generate PY from UI
Created February 3, 2019 20:35
Install Qt Designer and Editor Ubuntu
pyuic5 -x file.ui -o output.py
@tayyebi
tayyebi / vbox-osx.txt
Created September 4, 2018 08:44
How incept VirtualBox that this machine is Apple iMac; so the you can install OS X Mavericks humble and kind
VBoxManage modifyvm "Mavericks" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
source https://github.com/osmdroid/osmdroid