Skip to content

Instantly share code, notes, and snippets.

View mattiasghodsian's full-sized avatar
🏠
Working from home

mattiasghodsian

🏠
Working from home
View GitHub Profile
@mattiasghodsian
mattiasghodsian / index.html
Created November 10, 2018 11:25
[CSS] Blinking corners
<a href="#">buy now</a>
@mattiasghodsian
mattiasghodsian / wsl.conf
Last active July 2, 2019 22:36
Automatically Configuring Windows Subsystem for Linux
# Place wsl.conf in /etc
# Restart LxssManager by executing command Restart-Service LxssManager in PowerShell as admin
# For more options read: https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/
[automount]
enabled = true
root = /mnt/
options = "metadata,umask=22,fmask=11"
mountFsTab = false
@mattiasghodsian
mattiasghodsian / readme.md
Last active October 19, 2019 00:32
How to install OpenLiteSpeed on Ubuntu 18.04

How to install OpenLiteSpeed on Ubuntu 18.04

OpenLiteSpeed is a open source web server version of LiteSpeed Web Server Enterprise by LiteSpeed Technologies. Known for being lightweight, PageSpeed Optimization, Intelligent Cache Acceleration and more.

Getting Started

In this How to, we'll guide you step by step to install apps OpenLiteSpeed on your Ubuntu 18.04 machine.

NOTE

Successfully tested with WSL (Windows Subsystem for Linux) Ubuntu 18.04 LTS (19/07/2019)

Step 1: Update your system

@mattiasghodsian
mattiasghodsian / readme.md
Created November 6, 2019 16:19
How to Fit an object to illustrator art board

Download script from aiscripts.com

Open the zip file and grab the .jsx file to your illustrator Scripts folder (located inside the software installed directory, See examples).

C:\Program Files (x86)\Adobe\Adobe Illustrator CS4\Presets\en_US\Scripts
C:\Program Files\Adobe\Adobe Illustrator CC 2015\Presets\en_US\Scripts
@mattiasghodsian
mattiasghodsian / functions.php
Created November 6, 2019 16:21
[Woocommerce] Custom user column & searchable meta
// Create user column
add_filter( 'manage_users_columns', 'new_modify_user_table' );
function new_modify_user_table( $column )
{
$column['kundnummer'] = 'Kundnummer';
return $column;
}
// Add content to user column
add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );
@mattiasghodsian
mattiasghodsian / tv-rename.ps1
Created December 1, 2019 21:05
Renames TV files
Write-Host "################################ `n### TV File renamer by https://github.com/mattiasghodsian ### `n################################`n" -ForegroundColor Red
$series = Read-Host -Prompt 'Enter Series name (no end space)'
Write-Host "Set $series" -ForegroundColor Red -BackgroundColor Yellow
$season = Read-Host -Prompt 'Enter Season (example 01)'
Write-Host "Set $season" -ForegroundColor Red -BackgroundColor Yellow
Write-Host "Processing"
$path = Get-Location
$int = 1
Get-ChildItem -Path $path -Recurse -Exclude *.ps1,*.zip -Filter "*" -file | %{
@mattiasghodsian
mattiasghodsian / thumbnails.ps1
Last active December 1, 2019 21:12
Generate thumbnail with ffmpeg | https://www.ffmpeg.org/download.html
Write-Host "################################ `n### Thumbnail generator by https://github.com/mattiasghodsian ### `n################################`n" -ForegroundColor Red
./ffmpeg -y -ss 00:00:10 -i input.mp4 -frames 1 -vf "drawtext=text='%{pts\:hms}': x=(w-tw)-20: y=(h-th)-20: fontcolor=white: fontsize=43: shadowcolor=black:shadowx=2:shadowy=2,fps=1/10,scale=-1:120,tile=4x4" out.png
start out.png
PAUSE
@mattiasghodsian
mattiasghodsian / hello.sh
Last active December 3, 2019 23:26
Terminal Welcome message
#!/bin/bash
# vars
os=$(lsb_release -sd)
codename=$(lsb_release -sc)
id=$(lsb_release -si)
pubip=$(dig @resolver1.opendns.com A myip.opendns.com +short -4)
locip=$(hostname -I | cut -d " " -f1)
ut=$(awk '{print int($1/86400)"days "int($1%86400/3600)":"int(($1%3600)/60)":"int($1%60)}' /proc/uptime)
qt=$(fortune -n 25 -s)
@mattiasghodsian
mattiasghodsian / readme.md
Last active December 19, 2019 15:02
[Wordpress] Manually backup WordPress

Export database with wp-cli

SSH to your site and go to the root folder of the WordPress installation and do

wp db export

Compress site

Move outside the root folder of WordPress and compress the folder (The db fils is located in the root folder and will be included).

@mattiasghodsian
mattiasghodsian / readme.md
Last active September 4, 2020 18:20
How to install Sonarr,Jackett,qBittorrent and mount network drive on Raspberry PI 4

~|~ I DO NOT INDORCE TORRENTING COPYRIGHT CONTENT - THIS IS MADE FOR EDUCATIONAL PURPOSES ONLY ~|~

1. Setup your Raspberry

  • Install Raspberry OS headless on your SD card and power it up with a screen, ether cable and keyboard
  • Enable SSH with sudo raspi-config and go to Interfaces and enable SSH
  • Change the password with Option one sudo raspi-config
  • sudo apt-get update then sudo apt-get upgrade -y

2. Install qbittorrent-nox

  • sudo apt-get update && sudo apt-get install qbittorrent-nox