在 Debian Wheezy 上要使用 DS4 手把流程如下:
- DS4 按下【PS】+【SHARE】,手把會閃白燈。
- Gnome 會提示你要不要授權配對,點 always 以後成功配對。
- 執行 sudo hidd --connect btaddr 手動啟用 HID 裝置。(需要裝 bluez-compat,DS4 走 Bluetooth 2.1 + EDR)
hidd search 會找不到手把,所以要自己啟用。啟用前請確定藍牙已經確實連線,DS4 燈號會持續亮著。
DPMSForceLevel(display, DPMSModeOn);
XResetScreenSaver(display);
XFlush(display);
DPMSGetTimeouts(display, &standby, &suspend, &offtime);
XGetScreenSaver(display, &timeout, &interval, &prefer_blanking, &allow_exposures);
Package:
Version:
Architecture:
Maintainer:
Installed-Size:
Depends:
Pre-Depends:
Recommends:
Suggests:
Breaks:
Replaces:
Provides:
Section:
Priority:
Multi-Arch:
Homepage:
Description:
$ sudo xboxdrv --silent --type xbox360 --device-by-id 046d:c21f --mimic-xpad --detach-kernel-driver
$ ar x package.deb
$ ar r package.deb debian-binary control.tar.gz data.tar.gz
$ fakeroot dpkg-deb -b [input_dir] [output_deb]
$ ln -s /tmp ~/.cache/telepathy/avatars
CPU | AMD Phenom x4 945 @3.0GHZ |
MB | Gigabyte GA870A-UD3 rev. 2.0 |
RAM | Kingston DDR3 1600 8GB (2GB x 4) |
VGA | MSI NVIDIA GTX460 768MB |
HDD | Liteon S100 64GB, WD FAEX SATA 6g 1TB |
DVD-RW | LITEON iHAS324 |
PSU | Seasonic X650 |
LCD | AOC e2440h |
Sound card | Onkyo SE200PCI |
TV/Capture card | Timeleak U1, Compro E650 |
OS | Debian 8.1 Jessie |
$ apt-get source [package]
$ apt-get build-dep [package]
$ dch -i
$ debuild -uc -us -b
$ gpg --export -a -o [filename] [name]
$ gpg --export-secret-key -a -o [filename] [name]
$ gpg --detach-sign -a [input_file]
$ gpg --verify [signature_file]
$ gpg -sea [input_file]
$ gpg -d [encrypted_file]
$ ssh -D [local_port] -Nf [remote_host]
$ ssh -NfR [remote_port]:localhost:22 [remote_host]
$ ssh -D [local_port] -Nf localhost -p [remote_port]
$ tccat -i target.vob | tcextract -x ps1 -t vob -a 0x20 > target.sub
其中 0x20 是語言碼。0x20 是中文,0x22 是英文。$ subtitle2pgm -o output_prefix -c 0,255,0,0 < target.sub
PangoRectangle strong;
PangoRectangle weak;
pango_layout_get_cursor_pos(pango_layout, strlen("あい"), &strong, &weak);
cairo_line_to(cairo_context, strong.x/PANGO_SCALE, strong.y/PANGO_SCALE);
cairo_rel_line_to(cairo_context, 0, strong.height/PANGO_SCALE);
cairo_stroke(cairo_context);
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xlocale.h>
#define TITLE_STRING "XIM test"
int main(int argc, char **argv)
{
int quit = False;
Display* display = NULL;
Window window;
XTextProperty title;
XEvent event;
Atom wm_delete_window;
XIM xim;
XIC xic;
int xim_status;
KeySym keysym;
int count = 0;
unsigned long fevent;
char buffer[256]= {};
/* Call XSetLocaleModifiers before initialize XIM */
setlocale(LC_ALL, "");
XSetLocaleModifiers("");
display = XOpenDisplay(NULL);
window = XCreateWindow(display, RootWindow(display, 0), 0, 0, 512, 512, 0, CopyFromParent, CopyFromParent, CopyFromParent, 0, NULL);
XSetWindowBackground(display, window, BlackPixel(display, 0));
title.value = (unsigned char*)TITLE_STRING;
title.encoding = XA_STRING;
title.format = 8;
title.nitems = strlen(TITLE_STRING);
XSetWMProperties(display, window, &title, &title, NULL, 0, NULL, NULL, NULL);
wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False);
XSetWMProtocols(display, window, &wm_delete_window, 1);
XMapWindow(display, window);
/* XIM initialization */
xim = XOpenIM(display, NULL, NULL, NULL);
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing ,XNClientWindow, window, NULL);
/* We need IC event to switch IME */
XGetICValues(xic, XNFilterEvents, &fevent, NULL);
XSelectInput(display, window, ExposureMask | KeyPressMask | FocusChangeMask | StructureNotifyMask | fevent);
XSetICFocus(xic);
while(!quit)
{
XNextEvent(display, &event);
if(XFilterEvent(&event, None))
continue;
switch(event.type)
{
case KeyPress:
count = XmbLookupString(xic, &event.xkey, buffer, 256, &keysym, &xim_status);
/* Cut redundant chars */
buffer[count] = 0;
if(xim_status == XLookupChars || xim_status == XLookupBoth)
fprintf(stderr, "%s\n", buffer);
break;
case ClientMessage:
if(event.xclient.data.l[0] == wm_delete_window)
{
XDestroyWindow(display, window);
quit = True;
}
break;
case FocusIn:
XSetICFocus(xic);
break;
case FocusOut:
XUnsetICFocus(xic);
break;
}
}
XCloseDisplay(display);
return 0;
}
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#define TITLE_STRING "Xlib test"
int main(int argc, char **argv)
{
int quit = False;
Display* display = NULL;
Window window;
XTextProperty title;
XEvent event;
Atom wm_delete_window;
display = XOpenDisplay(NULL);
window = XCreateWindow(display, RootWindow(display, 0), 0, 0, 512, 512, 0, CopyFromParent, CopyFromParent, CopyFromParent, 0, NULL);
XSetWindowBackground(display, window, BlackPixel(display, 0));
title.value = (unsigned char*)TITLE_STRING;
title.encoding = XA_STRING;
title.format = 8;
title.nitems = strlen(TITLE_STRING);
XSetWMProperties(display, window, &title, &title, NULL, 0, NULL, NULL, NULL);
wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False);
XSetWMProtocols(display, window, &wm_delete_window, 1);
XSelectInput(display, window, ExposureMask | KeyPressMask | StructureNotifyMask);
XMapWindow(display, window);
while(!quit)
{
XNextEvent(display, &event);
switch(event.type)
{
case ClientMessage:
if(event.xclient.data.l[0] == wm_delete_window)
{
XDestroyWindow(display, window);
quit = True;
}
break;
}
}
XCloseDisplay(display);
return 0;
}