Skip to content

Instantly share code, notes, and snippets.

View joshschmelzle's full-sized avatar
༼ つ ◕_◕ ༽つ ø

jsz joshschmelzle

༼ つ ◕_◕ ༽つ ø
View GitHub Profile
@joshschmelzle
joshschmelzle / ffmpeg-slow-a-video.md
Last active December 4, 2023 21:46
Slow a video down with ffmpeg

To slow down your video, you have to use a multiplier greater than 1:

ffmpeg -i input.mkv -filter:v "setpts=2.0*PTS" output.mkv

For example, to double the speed of the video, you can use:

ffmpeg -i input.mkv -filter:v "setpts=0.5*PTS" output.mkv

Source

To look up files recursively in the given directory for the given text, and display the file name with line number that has the matching text.

grep -rHn "text to search" /path/to/dir

To use a search pattern, use the following command:

grep -rHn -e "text pattern to search" /path/to/dir

Args:

Simple CURL commands

Curl is a tool to transfer data from or to a server. It supports a busload of protocols and useful tricks. Here is how to simply use CURL.

Get the main page from Google's web-server:

curl http://www.google.com

Using a proxy and getting the main page from Google's web-server:

@joshschmelzle
joshschmelzle / lynx-proxy.md
Created December 15, 2016 13:33
Lynx 2.8.8re1.1 win32 proxy config

Add http_proxy:http://your.proxy.com:8080 to C:\Program Files (x86)\Lynx - web browser\lynx.cfg

@joshschmelzle
joshschmelzle / win-clippy.md
Last active December 15, 2016 14:52
Copy win32 command line output to Windows Clipboard

To save the output of a command on the Windows clipboard, add a pipe* (|) operator to your command followed by the clip command.

Examples

dir | clip - copy the listing of current folder contents to the clipboard.

tree | clip - copy a recursive directory structure to the clipboard.

pwd | clip - copy the present working directory to the clipboard.

@joshschmelzle
joshschmelzle / grep-count.md
Created December 20, 2016 14:34
Grep only count occurrences

grep -ro "pattern to find in files" "directory to recursively search" | grep -c "pattern to find in files"

This solution will count all occurrences even if there are multiple on one line.

-r recursively searches the directory

-o will "show only the part of a line matching PATTERN" 

this is what splits up multiple occurences on a single line and makes grep print each match on a new line;

@joshschmelzle
joshschmelzle / Mozilla SSL Configuration Generator
Created December 20, 2016 14:38
Mozilla SSL Configuration Generator
https://mozilla.github.io/server-side-tls/ssl-config-generator/
@joshschmelzle
joshschmelzle / return external ip.md
Last active February 10, 2017 14:14
Return IP information in JSON regarding your current external ip address

if you're not behind a proxy

curl ipinfo.io

if through proxy

e.g. using -x --- that's a lowercase x

curl -x http://internet.proxy.com:8080 ipinfo.io

@joshschmelzle
joshschmelzle / pandoc-pdf-svg.md
Created December 22, 2016 21:07
Using Pandoc with SublimeText3 to Export Markdown+SVG to PDF on win32

Make sure to install inkscape, pip, python and that they are all in your win32 path.

To check installation and version-

  • pip -V
  • python -V
  • pandoc -v
  • inkscape -V

Pandoc.sublime-settings:

@joshschmelzle
joshschmelzle / Quickest-to-access-the-win10-Startup-folder.md
Created January 3, 2017 17:12
Quickest way to access the win10 Startup folder

To find the Startup folder, the quickest way is to do the following:

  1. Hold down the Windows key, and press R.
  2. Type: shell:startup.
  3. Click OK.