This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
strip_spaces () { | |
GRUB_CMDLINE_LINUX_DEFAULT=$(echo "$GRUB_CMDLINE_LINUX_DEFAULT" | sed "s/ \+/ /g;s/^ *//g;s/ *$//g") | |
} | |
remove_parameters () { | |
for i in "$@"; do | |
GRUB_CMDLINE_LINUX_DEFAULT=$(echo "$GRUB_CMDLINE_LINUX_DEFAULT" | sed "s/$i//g") | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
if dpkg-query -W | grep rtl8723bs-bluetooth-dkms; then | |
sudo apt-get purge rtl8723bs-bluetooth-dkms | |
fi | |
sudo dpkg -i rtl8723bs-bluetooth-misc_150212chestersmill2_amd64.deb | |
if ! grep "Enable=Gateway" /etc/bluetooth/audio.conf; then | |
echo "Enable=Gateway" | sudo tee -a /etc/bluetooth/audio.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# -*- coding: utf-8; indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- | |
def main(): | |
from gi.repository import Gtk | |
dialog = Gtk.Dialog("DEBUG") | |
dialog.add_buttons("Close", Gtk.ResponseType.CLOSE) | |
dialog.run() | |
print("Hello World!") | |
dialog.destroy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "=== Clear all EFI boot entries ===" | |
sudo apt-get --yes install efibootmgr | |
sudo efibootmgr -v | grep ^Boot[0-9A-F][0-9A-F][0-9A-F][0-9A-F] | cut -c 5-8 | while read boot; do | |
sudo efibootmgr -v -b $boot -B | |
done | |
sudo efibootmgr -O | |
sudo efibootmgr -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
find /sys -name control | grep -v debug | while read file; do | |
if [ "$(cat $file)" = "auto" ]; then | |
echo "$file is still auto." | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- coding: utf-8; indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- */ | |
/** | |
* Copyright (C) 2014 Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com> | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
#!/usr/bin/env bash | |
export DEBIAN_FRONTEND=noninteractive | |
echo '==> Preparing prerequisite...' | |
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/60language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Refer 1. http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+5%3A+GUI+toolkit+integration | |
// Refer 2. http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideooverlay.html | |
// gcc playback.c -o playback `pkg-config --cflags --libs gtk+-3.0 gstreamer-1.0 gstreamer-video-1.0` | |
#include <gst/video/videooverlay.h> | |
#include <gtk/gtk.h> | |
#ifdef GDK_WINDOWING_X11 | |
#include <gdk/gdkx.h> // for GDK_WINDOW_XID | |
#endif | |
#ifdef GDK_WINDOWING_WIN32 | |
#include <gdk/gdkwin32.h> // for GDK_WINDOW_HWND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8; indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- | |
# | |
# Copyright (C) 2014 Shih-Yuan Lee (FourDollars) <sylee@canonical.com> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* gcc gio_mount_disk.c `pkg-config --cflags glib-2.0 gio-unix-2.0 --libs` -o gio_mount_disk */ | |
#include <stdio.h> | |
#include <glib.h> | |
#include <gio/gunixmounts.h> | |
int main(int argc, char* argv[]) | |
{ | |
GList *p, *points = g_unix_mount_points_get (NULL); | |
for (p = points; p != NULL; p = p->next) { |