Skip to content

Instantly share code, notes, and snippets.

View alifa98's full-sized avatar
🎯
Focusing

Ali Faraji alifa98

🎯
Focusing
  • YorkU
  • Toronto
  • 16:18 (UTC -04:00)
View GitHub Profile

run the application like this: DRI_PRIME=1 vlc

now, the vlc runs on second GPU ! :)

@alifa98
alifa98 / instructions.MD
Last active October 11, 2021 09:21
Fake Camera by OBS
  • Install https://github.com/umlaeute/v4l2loopback (You can install v4l2loopback-dkms by package managers such as pamac and apt )
  • Run sudo modprobe -r v4l2loopback && sudo modprobe v4l2loopback devices=1 video_nr=20 card_label="fakecam" exclusive_caps=1 Options
  • Create your desired scenes on OBS.
  • From "OBS" > "Tools" > "V4L2 video Output" select /dev/video20 (because of video_nr=20 option in command) and click on the start button.
  • Go to the application you want to use this camera, and select fakecam as webcam :)

If you have problem with finding fakecam, try command without exclusive_caps=1 option.

@alifa98
alifa98 / How to limit digital pen to one monitor.md
Last active October 9, 2021 05:48
I have a Genius EasyPen i405X, and I want to limit this pen to one of my monitors.
  • Command for list outputs: xrandr
  • Command to list available input devices: xinput
  • Map movements of x input device to specific output device: xinput map-to-output <Input Device ID> <Output Device Name>

for example: xinput map-to-output 15 DP-1

@alifa98
alifa98 / Graph-Theory-Research1.tex
Last active May 29, 2021 19:33
Products in Graph Theory and its properties
\documentclass[12pt, a4]{article}
%% find this on: https://gist.github.com/alifa98/4fbdd935b2419b520a7a635d5e2da12a
\usepackage{amsthm,amssymb,amsmath,amsfonts}
\usepackage[top=30mm, bottom=30mm, left=25mm, right=30mm]{geometry}
\usepackage{graphicx}
\usepackage{color}
\usepackage{setspace}
\usepackage{titletoc}
\usepackage{tocloft}
[ \e[35m\A \e[33m\u\e[90m@\e[31m\h\e[39m:\e[34m\w \e[39m] $

Make Time lapse from desktop

command to take 3600 screenshots wit 3s delay. (3 hours)

Save screens in pwd of terminal

for i in {1..3600}; do scrot -d 3 '%Y-%m-%d-%H:%M:%S.png' ; done

convert screenshots to video file

This command convert images in pwd/directory/ to full resolution video (FPS = 30):

@alifa98
alifa98 / ABOUT.md
Created March 24, 2020 12:48 — forked from laobubu/ABOUT.md
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
@alifa98
alifa98 / install-oracle-sql-developer.md
Created March 24, 2020 12:45 — forked from bmaupin/install-oracle-sql-developer.md
Install Oracle SQL Developer on Ubuntu/Debian
@alifa98
alifa98 / .gitignore
Created June 4, 2019 17:41
gitignore file for java project [intelliJ]
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
@alifa98
alifa98 / center.java
Created May 24, 2019 11:19
How to center a Jframe in swing
jframe.setLocationRelativeTo(null); //this should be done after setting the size or calling pack(), but before setting it visible, like this:
/*
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
*/