Skip to content

Instantly share code, notes, and snippets.

View SwapnilSoni1999's full-sized avatar
👨‍💻
SGFoYSEgWW91IGRlY29kZWQgaXQuIGxldHMgY29ubmVjdC4K

Swapnil Soni SwapnilSoni1999

👨‍💻
SGFoYSEgWW91IGRlY29kZWQgaXQuIGxldHMgY29ubmVjdC4K
View GitHub Profile
@nrk
nrk / command.txt
Created April 2, 2012 19:19
Using ffprobe to get info from a file in a nice JSON format
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"
@boldfacedesign
boldfacedesign / JS Sleep
Created January 28, 2014 17:05
JavaScript sleep (wait) function
function sleep(milliseconds) {
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + milliseconds);
}
sleep(10000);
@scmx
scmx / upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Last active November 6, 2019 15:31
Upgrade/Install ruby 2.1.2 #ubuntu #12.04 #14.04

Upgrade/Install ruby 2.1.2

ubuntu 12.04 14.04

Reference http://stackoverflow.com/a/18490935/2037928

Login as root

Install needed packages

apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active June 8, 2024 10:38
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@tigerhawkvok
tigerhawkvok / restartAudio.bat
Created March 4, 2016 20:30
Restart Windows Audio Service (with admin permissions, if needed)
rem Written for buggy audio drivers that need to be restarted
rem In my case, the Claro 8.18 drivers bug out every once in a while on Windows 10, and need restarting to not sound poppy
@echo off
goto check_Permissions
:check_Permissions
echo Administrative permissions required to run this script. Checking...
net session >nul 2>&1
@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@ECHO OFF&PUSHD %~DP0
TITLE title KMS_Activation for Windows 10
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行!&&Pause >nul&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion
::修改下面的内容,定义选择想使用的KMS服务器。如果定义了多次,最后的有效
::set KMS_Sev=192.168.2.8
::set KMS_Sev=1.2.7.0
@davestewart
davestewart / broadcast-channel.md
Last active May 14, 2024 18:53
Example of using BroadcastChannel to communicate with pages in the same domain

screenshot

@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active May 10, 2024 18:17
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@msfjarvis
msfjarvis / sepolicy.md
Last active December 16, 2023 20:50
How to write sepolicy to fix a denial