Skip to content

Instantly share code, notes, and snippets.

View vladislav805's full-sized avatar

Vladislav Veluga vladislav805

View GitHub Profile
@vladislav805
vladislav805 / firefox.md
Last active April 4, 2022 08:40
firefox

With description

browser.download.improvements_to_download_panel

Disables the new behavior when downloading a file. source

Versions: Firefox >=98. Earlier (false): a window opens with a choice of "Open in" and "Save". Now (true): a window with saving opens immediately.

browser.urlbar.trimURLs

Disable trim protocol in address bar.

@vladislav805
vladislav805 / windows10.md
Last active October 24, 2021 18:42
Cheatsheet by install and set up windows 10

Windows cheatsheet

Disable fast startup

  1. Right click by "Start";
  2. "Search";
  3. Find Control panel;
  4. Find Power options;
  5. In left side "Choose what the power buttons do";

Disable Photos app, enable legacy Photo viewer

@vladislav805
vladislav805 / arch.md
Last active November 4, 2021 08:54
Cheatsheet by install and using Arch Linux

Arch Linux

Install Arch Linux with EFI

  1. Download ISO from official site
  2. Burn the ISO to a USB flash using Rufus with Partition Scheme = GPT, Target = EFI (non CSM).
  3. Boot to BIOS/UEFI, disable CSM.
  4. Boot from USB flash with EFI.
  5. Check connection with Internet

ping -c 2 google.com

Pacman

-S: Installing wiki

Install package

# pacman -S package

-Sy, -Syy

Sync (analog apt update). Double y - force sync.

-Su

@vladislav805
vladislav805 / HEAD-detached-fix.sh
Created October 2, 2019 12:50
HEAD detached fix
TARGET_BRANCH="master"
TEMPORARY_BRANCH="temp"
git branch "$TEMPORARY_BRANCH"
git checkout "$TEMPORARY_BRANCH"
git branch -f "$TARGET_BRANCH" "$TEMPORARY_BRANCH"
git checkout "$TARGET_BRANCH"
git branch -d "$TEMPORARY_BRANCH"

ffmpeg tips

Examples

Download HLS to file

ffmpeg -i input.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4
#!/bin/bash
TOKEN="..."
echo "Enter URL to video (in format OID_VID)"
read vkUrl
#vkUrl="203384908_456239021"
hls=$(wget -qO - "https://api.vk.com/method/video.get?videos=$vkUrl&access_token=$TOKEN&v=5.56" | grep -iowE "hls\"\:\"http[^\"]*\"" | grep -iowE "http.[^\"]*" | sed 's!\\/!/!g')
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class Gauss {
public static void swapRows(double[][] a, double[] b, int i, int j) {
double[] row = a[i];
@vladislav805
vladislav805 / reArrangeFiles.php
Last active January 3, 2017 17:15
Rearrange $_FILES from { name = [1, 2, 3], size = [1, 2, 3], ... } to [ { name = 1, size = 1 }, { name = 2, size = 2 }, ... ]
<?
function reArrayFiles(&$files) {
$result = [];
$keys = array_keys($files);
for ($i = 0, $l = sizeof($files["name"]); $i < $l; $i++) {
foreach ($keys as $key) {
$result[$i][$key] = $files[$key][$i];
};
Number.prototype.toData = function() {
if (this <= 0) {
return "0 bytes";
};
var n;
for (var i = 5; i >= 0; --i) {
n = Math.round(this / Math.pow(1024, i) * 10) / 10;
if (n >= 1) {
return n + " " + ["b", "KB", "MB", "GB", "TB"][i]);