Skip to content

Instantly share code, notes, and snippets.

@wswld
wswld / compress_pdf.md
Created July 19, 2020 06:37 — forked from ahmed-musallam/compress_pdf.md
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9

@brainfucksec
brainfucksec / bash.bashrc
Last active May 1, 2024 09:24
Termux bash.bashrc
######################################
#
# Termux bash.bashrc
# by brainf+ck
#
# Last modified: 2022/06/30
#
######################################
#### Global ##########################

So you bought a ColorOS powered phone (Oppo/Realme) and aren't liking the decisions made by OS.

Launcher

I use Customized Pixel Launcher which allows me to hide apps from App Drawer and get notification drawer by swiping down on homescreen. That pretty much makes the phone look like stock android.

Bloatware Apps

The second thing you would want to do is uninstall useless apps that can't be disabled.

@Log1x
Log1x / debloatNox.md
Last active September 20, 2024 07:55
Debloating & Optimizing Nox

Debloating Nox

Nox, despite being the most feature-filled Android emulator, has a lot of negativity surrounding it due to their antics when it comes to making income off of their program. It is known for running repeated advertisments in the background, calling home and passing along system information (outside of your Android instance) as well as a vast amount of potentially sensitive data in an encrypted payload back to their multitude of servers. With the following preventitive measures, we can stop a majority of this happening as well as greatly improve the overall performance.

  1. Download and Install a fresh copy of Nox. The latest version is fine (for now). If you already have it installed, that is fine too. No need to reinstall.

  2. Enable Root Mode on Nox by clicking the gear icon and then checking the Root Startup box.

  3. Install a new Launcher from the Play Store. ANYTHING but Nox's default. I suggest [Nova Launcher](https://play.google.com/s

@steviecoaster
steviecoaster / New-DotNetToast.ps1
Created November 16, 2018 19:48
Create a WIndows 10 Toast notification using .Net
Function New-DotNetToast {
[cmdletBinding()]
Param(
[Parameter(Mandatory, Position = 0)]
[String]
$Title,
[Parameter(Mandatory,Position = 1)]
[String]
$Message,
{
0x1800: 'org.bluetooth.service.generic_access', // Generic Access
0x1811: 'org.bluetooth.service.alert_notification', // Alert Notification Service
0x1815: 'org.bluetooth.service.automation_io', // Automation IO
0x180F: 'org.bluetooth.service.battery_service', // Battery Service
0x1810: 'org.bluetooth.service.blood_pressure', // Blood Pressure
0x181B: 'org.bluetooth.service.body_composition', // Body Composition
0x181E: 'org.bluetooth.service.bond_management', // Bond Management Service
0x181F: 'org.bluetooth.service.continuous_glucose_monitoring', // Continuous Glucose Monitoring
0x1805: 'org.bluetooth.service.current_time', // Current Time Service
@jchandra74
jchandra74 / PowerShell Customization.md
Last active August 20, 2024 20:27
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active September 19, 2024 19:00
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
{
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from: http://stackoverflow.com/questions/14306048/controling-volume-mixer