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
For waking up from suspension, I create the following script /etc/pm/sleep.d/brightness: | |
```shell | |
#!/bin/sh | |
case "$1" in | |
resume|thaw) | |
echo 170 > /sys/class/backlight/intel_backlight/brightness | |
;; | |
esac | |
``` |
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
rm -rf system/app/AntHalService | |
rm -rf system/app/Apollo | |
rm -rf system/app/BasicDreams | |
rm -rf system/app/BookmarkProvider | |
rm -rf system/app/Browser | |
rm -rf system/app/CellBroadcastReceiver | |
rm -rf system/app/CMFileManager | |
rm -rf system/app/CMHome | |
rm -rf system/app/CMWallpapers | |
rm -rf system/app/DashClock |
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
import socket | |
import select | |
import sys | |
import string | |
key = 'abcdefghijklmnopqrstuvwxyz' | |
def encrypt(n, plaintext): | |
"""Encrypt the string and return the ciphertext""" | |
result = '' |
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
Through the Rod Smith’s guidance and a few dirty tricks, I was successfully able to convert my GPT partition – without data loss or deleting any partitions – and then boot Windows 7 in legacy/MBR mode. In order to do this you’ll need your Windows installation media at hand as well as a copy of the Fedora 16 Live media. If you don’t have a copy of Fedora 16 Live handy, you can download the Live media ISO (64-bit) from a local mirror here | |
Keep in mind that at this point I only had 3 partitions and a bunch of unpartitioned space on the disk, so conversion was a rather straightforward process (all GPT partitions mapped directly to primary partitions). Although it is theoretically possible to convert GPT partitions with >4 partitions by defining which ones are to be logical partitions after conversion, I have not tested this. | |
Boot your Fedora 16 Live media and wait for your session to start. If you’re having troubles booting, press Tab at the boot loader screen and try booting with the nomodeset parameter ad |
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
select employees.emp_no, first_name, last_name, count(dept_no) jml_dpt | |
from employees join dept_emp on employees.emp_no = dept_emp.emp_no | |
group by employees.emp_no, first_name, last_name | |
having count(dept_no) = 2; |
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
BEGIN | |
DECLARE | |
email_count INT; | |
SELECT COUNT(*) | |
INTO email_count | |
FROM employees | |
WHERE LCASE() | |
IF email_count > 0 | |
THEN | |
SET NEW.email = CONCAT_WS(NEW.lastName, LEFT(NEW.firstName, 1), email_count, '@classicmodelcars.com'); |
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/bash | |
echo "Installing..." | |
curl https://i.jpillora.com/cloud-torrent! | bash | |
wget -O /etc/systemd/system/cloud-torrent.service https://gist.github.com/maulvi/f1df32bd73dcb709709c7afd30247a06/raw/4af916288313cf9ab24558986b4fee67239aa09a/cloud-torrent.service | |
systemctl enable cloud-torrent | |
systemctl start cloud-torrent | |
echo "cloud torrent running" |
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
[Unit] | |
Description=cloud-torrent | |
[Service] | |
WorkingDirectory=/root/ | |
ExecStart=/usr/local/bin/cloud-torrent --port 81 --config-path /root/cloud-torrent.json --title "Cloud" | |
Restart=always | |
RestartSec=3 | |
[Install] |
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
## | |
## Arch Linux repository mirrorlist | |
## Filtered by mirror score from mirror status page | |
## Generated on 2017-05-31 | |
## | |
## Japan | |
Server = http://ftp.tsukuba.wide.ad.jp/Linux/archlinux/$repo/os/$arch | |
## Japan | |
Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch |
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 | |
import sys, os, socket | |
from socketserver import ThreadingMixIn | |
from http.server import SimpleHTTPRequestHandler, HTTPServer | |
HOST = socket.gethostname() | |
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer): | |
pass |