Skip to content

Instantly share code, notes, and snippets.

View tinywm-xcb.c
/* TinyWM is written by Nick Welch <mack@incise.org>, 2005.
* TinyWM-XCB is rewritten by Ping-Hsun Chen <penkia@gmail.com>, 2010
*
* This software is in the public domain
* and is provided AS IS, with NO WARRANTY. */
#include <xcb/xcb.h>
int main (int argc, char **argv)
{
View set_wm_class.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
int main(int argc, char *argv[])
{
unsigned long value;
char *terminatedAt;
@jaimet
jaimet / WinUSBFromLinux.md
Created Jun 7, 2019 — forked from kuznero/WinUSBFromLinux.md
How to make Windows 7 USB flash install media from Linux?
View WinUSBFromLinux.md

How to make Windows 7 USB flash install media from Linux?

StackOverflow

  • Install ms-sys - if it is not in your repositories, get it here. Or alternatively, make sure lilo is installed (but do not run the liloconfig step on your local box if e.g. Grub is installed there!)
  • Check what device your USB media is assigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS (7), and remember to set it bootable:
# cfdisk /dev/sdb
or fdisk /dev/sdb (partition type 7, and bootable flag)
@jaimet
jaimet / iw_scan.awk
Created Feb 16, 2019 — forked from miyalys/iw_scan.awk
simplify the output of iw scan
View iw_scan.awk
# Based off this answer http://stackoverflow.com/a/17880517/1172409
# Ideally one wouldn't parse the output of iw scan (it may be subject to change),
# but dealing with learning libnl which iw uses seems overly complicated - more so than updating this in case iw does change.
# A few things that could be improved:
# Better padding solution for prettier pretty printing.
# Sort APs based off signal strength from best to worst.
# Usage - iw must be run as root (suggestion: add as an alias in bashrc):
# iw wlp8s0 scan | awk -f scan.awk
@jaimet
jaimet / brightness.md
Created Jan 17, 2019 — forked from reliq/brightness.md
Optimus (Dual Graphics) - Backlight Keys Workaround (Ubuntu/Linux Mint)
View brightness.md

Adapted from here.

Get Fn F5/F6 working:

sudo emacs etc/default/grub

Change the following: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="

sudo update-grub

reboot the system... Now the splash screen should show up.

@jaimet
jaimet / ImageBuilder.java
Created Aug 17, 2018 — forked from mridang/ImageBuilder.java
Gasflow Notification Icon Generator
View ImageBuilder.java
package com.mridang.dashbar;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Typeface;
import android.os.Environment;
View adblogcatOutput
06-23 15:36:56.501 1997 2071 D Yamaha-MC1N2-Audio: yamaha_mc1n2_audio_output_stop()
06-23 15:36:56.502 1997 2071 D Yamaha-MC1N2-Audio: yamaha_mc1n2_audio_route_start()
06-23 15:36:58.178 25768 25768 W ComposeMessageActivity: Selected: 5
06-23 15:36:58.183 25768 25768 W AttachmentManager: captureUri path is /storage/emulated/0/Android/data/org.thoughtcrime.securesms/files/1498228562023.jpg
06-23 15:36:58.188 2348 6159 I ActivityManager: START u0 {act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=org.cyanogenmod.snap/com.android.camera.PhotoCamera clip={text/uri-list U:file:///storage/emulated/0/Android/data/org.thoughtcrime.securesms/files/1498228562023.jpg} (has extras)} from uid 10080 on display 0
06-23 15:36:58.197 1997 2071 D Yamaha-MC1N2-Audio: yamaha_mc1n2_audio_output_start()
06-23 15:36:58.197 1997 2071 D Yamaha-MC1N2-Audio: yamaha_mc1n2_audio_route_start()
06-23 15:36:58.197 1997 2071 D Yamaha-MC1N2-Audio: (yamaha_mc1n2_audio_params_route_find): device = 2, direction = 0
06-23 15:36:58.24
You can’t perform that action at this time.