Skip to content

Instantly share code, notes, and snippets.

@uugr
uugr / osx_kvm.sh
Created January 16, 2023 13:04
OSX_KVM Shell Script
#!/usr/bin/env bash
# Special thanks to:
# https://github.com/Leoyzen/KVM-Opencore
# https://github.com/thenickdude/KVM-Opencore/
# https://github.com/qemu/qemu/blob/master/docs/usb2.txt
#
# qemu-img create -f qcow2 mac_hdd_ng.img 128G
#
# echo 1 > /sys/module/kvm/parameters/ignore_msrs (this is required)
@uugr
uugr / PKGBUILD
Last active March 25, 2020 09:47
Updated PKGBUILD file for esp-idf-git package
# Maintainer: Jose Riha <jose1711 gmail com>
pkgname=esp-idf-git
_pkgname=esp-idf
pkgver=r12430.6330b3345
pkgrel=1
pkgdesc="ESP specific API/libraries from Espressif"
arch=('i686' 'x86_64')
url="https://github.com/espressif/esp-idf"
license=('Apache')
@uugr
uugr / .nvidia-settings-rc
Created March 28, 2017 07:55
[Linux / GT540M] Nvidia Settings File For Underclocking GPU
# Configuration file for nvidia-settings - the NVIDIA X Server Settings utility
# Generated on Sun Mar 19 23:29:24 2017
#
# ConfigProperties:
RcFileLocale = C
DisplayStatusBar = Yes
SliderTextEntries = Yes
IncludeDisplayNameInConfigFile = Yes
@uugr
uugr / dnscrypt-proxy@.service
Created January 21, 2017 19:39
Arch Linux Multiple "dnscrypt-proxy" Instances
# Install dnscrypt-proxy and create a user $(dnscrypt_user) for dnscrypt-proxy $(useradd -r -d /var/dnscrypt -m -s /sbin/nologin dnscrypt)
# Put .service and .socket file to /etc/systemd/system
# Enable service file and Start service
# Multiple .sockets can be created on the same port with different IPs
[Unit]
Description=DNSCrypt client proxy
Documentation=man:dnscrypt-proxy(8)
Requires=dnscrypt-proxy@%I.socket
After=network.target
@uugr
uugr / start_steam.bat
Created January 11, 2016 14:30
Start Steam via Batch Script (Switch Account)
::---------------------USAGE -----------
::Create a shortcut for steam.exe and add "-login username password" parameters to target w/o quotes
::Replace Shortcut Where You Want
::Edit Directory and name of the shorcut in :start_steam section for yourself
@echo off
tasklist /FI "IMAGENAME eq steam.exe" 2>NUL | find /I /N "steam.exe">NUL
if %ERRORLEVEL%==0 goto :kill
if %ERRORLEVEL%==1 goto :start_steam
@uugr
uugr / reload.sh
Created September 3, 2014 22:38
rtl8187 Module Reload - Sudo Auth with Zenity
######################################
# Save into a directory (eg. ~) #
# Add a new alias to shell_rc #
# And run it from console #
# OR #
# Make It Nautilus Script #
######################################
#!/bin/bash
@uugr
uugr / conky.sh
Created March 3, 2013 17:20
Conky Transparency Workaround For Gnome Shell (Tested With 3.6.2)
#------------------------------------------------------------------------------#
# Use "own_window_type panel" for transparent background #
# #
# "own_window_type override" doesn't work with transparent background #
# Conky always have a black background. #
# #
# "own_window_type panel" work as panel when you start, it have egdes etc. But #
# if you change conkyrc, conky loses "panel" condition and start working like #
# "own_window_override" minimizing windows doesn't affect Conky's window. #
# It always stays on Desktop as transparent #
@uugr
uugr / gist:2820789
Last active October 5, 2015 14:27
Gnome Change Background [Wallch]
#!/bin/bash
###########################################################################
# Nautilus script for Wallch
# This script changes desktop wallpaper via command "wallch --next"
#
# Usage:
# Move the script under /home/$USER/.local/share/nautilus/scripts/
# Set executable permission for script. chmod +x scriptname
#
# This Program Licensed and Distributed under the terms of GPLv3
@uugr
uugr / factorial_calc.c
Created April 24, 2012 06:54
Factrorial calculation In C
#include <stdio.h>
unsigned long faktoriyel(int); //prototip tanımı
int main ()
{
long deg1;
deg1=faktoriyel(14);
printf ("14!=%ld\n",deg1);
return 0;
}
@uugr
uugr / multmatrix.c
Created April 16, 2012 16:09
4x4 Matrix Multiplication
#include <stdio.h>
int main(){
int matA[4][4]={{0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}};
int matB[4][4]={{0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}};
int matC[4][4];
int i,j,k;
for (i=0;i<4;i++){
for(j=0;j<4;j++){
matC[i][j] = 0;
for(k=0;k<4;k++){