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 / gstreamer.txt
Created April 27, 2020 06:37
Camera Virtualization
gst-launch-1.0 -v v4l2src device=/dev/video0 ! \
ffmpegcolorspace ! \
video/x-raw-rgb ! \
ffmpegcolorspace ! \
video/x-raw-yuv,format=\(fourcc\)YUY2 ! \
v4l2sink device=/dev/video2
# Alternative
gst-launch-1.0 -v v4l2src device=/dev/video2 ! \
v4l2sink device=/dev/video5
@tayyebi
tayyebi / 1.pdate.sql
Last active September 25, 2020 16:15 — forked from joyofdata/gist:26e49e77285e35bc2439
Setting Up a Time Dimension Table in MySQL
-- Gregorian - Jalali Date Converter Functions for Mysql, v2.0.0
-- Copyright (C) 2019 Mohammad Saleh Souzanchi(saleh.souzanchi@gmail.com|https://github.com/zoghal), Mehran . M . Spitman
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
'''
"Corona Music"
Stay At Home, Challenge of Hamedan Artists
Author: Mohammad R Tayyebi
Preqrequiesties: apt install beep
Links:
https://stackoverflow.com/questions/974071/python-library-for-playing-fixed-frequency-sound
## Link to excel export of market watch
http://members.tsetmc.com/tsev2/excel/MarketWatchPlus.aspx?d=0&format=0
## Variables list
inscode: "15521712617204216"
iid: "IRO1SFKZ0001"
l18: "سفارس"
l30: "سيمان فارس و خوزستان"
py: "8557"
bvol: "5131363"
<!-- SOURCE: http://code2care.org/pages/chessboard-with-pieces-using-pure-html-and-css/ -->
<html>
<head>
<meta charset="UTF-8">
<title>Chessboard using Pure CSS and HTML</title>
<style type="text/css">
.chessboard {
width: 640px;
height: 640px;
margin: 20px;
<!-- SOURCE: http://code2care.org/pages/chessboard-with-pieces-using-pure-html-and-css/ -->
<html>
<head>
<meta charset="UTF-8">
<title>Chessboard using Pure CSS and HTML</title>
<style type="text/css">
.chessboard {
width: 640px;
height: 640px;
margin: 20px;
sudo adduser <username> www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rw /var/www
systemctl restart apache2
sudo a2enmod rewrite
<Directory /var/www/>
## 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
@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())
@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