Skip to content

Instantly share code, notes, and snippets.

@bogdanRada
bogdanRada / zsh_install.sh
Created April 17, 2020 09:10 — forked from blanklin030/zsh_install.sh
zsh_install
#!/bin/sh
#
# This script should be run via curl:
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or wget:
# sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#
# As an alternative, you can first download the install script and run it afterwards:
# wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
# sh install.sh
# Search filename in stash
function gitsearch()
{
searchCrit='stash\|'$1
git stash list | while IFS=: read STASH ETC; do echo "$STASH: $ETC"; git diff --stat $STASH~..$STASH --; done | grep -e $searchCrit
}
alias githunt=gitsearch

Stackoverflow answer link - https://stackoverflow.com/a/2068371/867451

Copied the content for quick reference


Each YouTube video has four generated images. They are predictably formatted as follows:

https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg

https://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg

@bogdanRada
bogdanRada / customize-mx-master-ubuntu.md
Created April 17, 2020 09:01 — forked from vukhanhtruong/customize-mx-master-ubuntu.md
Custom keymap for Logitech MX Master 2S mouse on Ubuntu

First, install Solaar to see the battery level on the taskbar

sudo apt-get install solaar

To remap the keys, install

sudo apt-get install xbindkeys xautomation
@bogdanRada
bogdanRada / ubuntu-hardening.md
Created April 17, 2020 08:55 — forked from dcalixto/ubuntu-hardening.md
List of things for hardening Ubuntu

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
Rails.logger.debug(ActiveSupport::LogSubscriber.new.send(:color, "D:#{var}", :red))
FROM: https://stackoverflow.com/questions/20969124/how-to-diff-directories-over-ssh
Try using "rsync" with the "-n" option, which just does a "dry run" and tells you what it would do.
answered Jan 7 '14 at 10:39
Mark Setchell
-c will tell rsync to look at checksums, not just date & length – Mike Aug 5 '14 at 22:07
--delete is needful. Without it, you won't see any files that are present on the 2nd machine but not on the 1st. Make sure you have the dry run -n option. – JellicleCat Mar 22 '15 at 15:12
@bogdanRada
bogdanRada / tsconfig.json
Created April 17, 2020 08:22
Sane defaults for typescript
{
"compilerOptions": {
"target": "es5", // Specify ECMAScript target version
"lib": [
"dom",
"dom.iterable",
"esnext"
], // List of library files to be included in the compilation
"allowJs": true, // Allow JavaScript files to be compiled
"skipLibCheck": true, // Skip type checking of all declaration files
@bogdanRada
bogdanRada / ffmpeg_mkv_mp4_conversion.md
Created April 17, 2020 08:20 — forked from thuan1412/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@bogdanRada
bogdanRada / readme.md
Created February 12, 2020 16:28 — forked from maxivak/readme.md
Integrating Gem/Engine and Main Rails App