OK, turing.

<- leave blank

Wed Apr 18 20:57:16 EDT 2018

fake online reviews


Wed Apr 18 05:47:43 EDT 2018
mpc() {
	if [[ $@ == "playlist" ]]; then
		command mpc playlist | cat -n
	else
		command mpc "$@"
	fi
}

downloads(){
	watch -ctn 1 "(echo -e '\033[32mGID\t\t
	Name\t\t\t\t\t\t\t%\tDown\tSize\tSpeed\tUp\tS/L\tTime\033[36m'; \
	diana list| cut -c -112; echo -e '\033[37m'; diana stats)"
}


Tue Apr 17 21:55:15 EDT 2018
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)
cannot handle selection request for '_VIMENC_TEXT' (622)
cannot handle selection request for '_VIM_TEXT' (621)


Tue Apr 17 17:45:16 EDT 2018
diff -r 2447a1b462c2 sys/src/cmd/tee.c
--- a/sys/src/cmd/tee.c Thu Apr 12 17:50:10 2018 -0400
+++ b/sys/src/cmd/tee.c Tue Apr 17 14:44:52 2018 -0700
@@ -13,6 +13,7 @@
 int aflag;

 char in[8192];
+int fds[128];

 int intignore(void*, char*);

@@ -54,9 +55,9 @@
		if(i < 0) {
			fprint(2, "tee: cannot open %s: %r\n", argv[0]);
		} else {
- if(i != n+FDSTART)
- dup(i, n+FDSTART);
- n++;
+ if (n == nelem(fds))
+ fprint(2, "tee: too many fds\n");
+ fds[n++] = i;
		}
		argv++;
	}
@@ -66,7 +67,7 @@
		if(r <= 0)
			exits(nil);
		for(i=0; i<n; i++)
- write(i+FDSTART, in, r);
+ write(fds[i], in, r);
		write(1, in, r);
	}
 }


Tue Apr 17 17:16:28 EDT 2018
#!/bin/rc

echo 'testing' |\
  tee -a \
  >{cat > /tmp/1.test} \
  >{cat > /tmp/2.test} \
  >{cat > /tmp/3.test} \
  >{cat > /tmp/4.test} \
  >{cat > /tmp/5.test} \
  >{cat > /tmp/6.test} \
  >{cat > /tmp/7.test} \
  >{cat > /tmp/8.test} \
  >{cat > /tmp/9.test} \
  >{cat > /tmp/10.test} \
  >{cat > /tmp/11.test} \
  >/dev/null

echo 'done'


-------------------- output
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:14 6.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:14 5.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 16 Apr 17 14:14 8.test
    0 [glenda] - --rw-r----- M 960 glenda glenda 0 Apr 17 14:14 10.test
    0 [glenda] - --rw-r----- M 960 glenda glenda 0 Apr 17 14:14 11.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:14 4.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:14 3.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:14 2.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:14 1.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 16 Apr 17 14:14 7.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:14 9.test

Tue Apr 17 17:02:37 EDT 2018
#!/bin/rc

echo 'testing' |\
  tee \
  >{cat > /tmp/1.test} \
  >{cat > /tmp/6.test} \
  >{cat > /tmp/0.5.test} \
  >{cat > /tmp/2.test} \
  >{cat > /tmp/3.test} \
  >{cat > /tmp/5.test} \
  >{cat > /tmp/12.test} \
  >{cat > /tmp/10.test} \
  >{cat > /tmp/0.25.test} \
  >/dev/null

echo 'done'


-----------output:

    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:01 3.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:01 0.5.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:01 10.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:01 2.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 16 Apr 17 14:01 12.test
    0 [glenda] - --rw-r----- M 960 glenda glenda 0 Apr 17 14:01 0.25.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:01 6.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:01 1.test
    1 [glenda] - --rw-r----- M 960 glenda glenda 8 Apr 17 14:01 5.test

Tue Apr 17 09:40:36 EDT 2018
full-stack marketeer

Tue Apr 17 09:38:27 EDT 2018
see who killed you (and more)

Tue Apr 17 07:43:50 EDT 2018
#Bridge VM
brctl addbr br0
brctl addif br0 eth0
ifconfig br0 192.168.0.120 netmask 255.255.255.0 up
route add -net 192.168.0.0 netmask 255.255.255.0 br0
route add default gw 192.168.0.1 br0
### qemu/windows
ip tuntap add tap1 mode tap
ifconfig tap1 down
brctl addif br0 tap1
ifconfig tap1 up


Tue Apr 17 05:17:40 EDT 2018
diff -r b3647f81f4f6 Makefile
--- a/Makefile Tue Mar 20 03:45:36 2018 -0500
+++ b/Makefile Tue Apr 17 10:17:35 2018 +0100
@@ -38,6 +38,7 @@
 clean:
	rm -f *.o */*.o */*.a *.a drawterm drawterm.exe

+.PHONY: $(LIBS1)
 kern/libkern.a:
	(cd kern; $(MAKE))

diff -r b3647f81f4f6 gui-win32/screen.c
--- a/gui-win32/screen.c Tue Mar 20 03:45:36 2018 -0500
+++ b/gui-win32/screen.c Tue Apr 17 10:17:35 2018 +0100
@@ -307,6 +307,32 @@
		p[i] = i;
 }

+void
+togglefull(HWND hwnd)
+{
+ static int full;
+ static LONG style, exstyle;
+ static WINDOWPLACEMENT pl;
+ MONITORINFO mi;
+
+ full = !full;
+ if(full){
+ SendMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
+ style = GetWindowLong(hwnd, GWL_STYLE);
+ exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
+ pl.length = sizeof(WINDOWPLACEMENT);
+ GetWindowPlacement(hwnd, &pl);
+ SetWindowLong(hwnd, GWL_STYLE, style & ~(WS_CAPTION | WS_THICKFRAME));
+ SetWindowLong(hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_DLGMODALFRAME |
WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
+ mi.cbSize = sizeof(MONITORINFO);
+ GetMonitorInfo(MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST), &mi);
+ SetWindowPos(hwnd, NULL, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right
- mi.rcMonitor.left, mi.rcMonitor.bottom - mi.rcMonitor.top, SWP_NOZORDER |
SWP_NOACTIVATE | SWP_FRAMECHANGED);
+ }else{
+ SetWindowLong(hwnd, GWL_STYLE, style);
+ SetWindowLong(hwnd, GWL_EXSTYLE, exstyle);
+ SetWindowPlacement(hwnd, &pl);
+ }
+}

 Rune vk2rune[256] = {
 [VK_CANCEL] Kbreak,
@@ -409,6 +435,8 @@
		break;
	case WM_SYSKEYUP:
	case WM_KEYUP:
+ if(wparam == VK_PAUSE)
+ togglefull(hwnd);
		i = (lparam>>16)&0xFF;
		k = scdown[i];
		if(k != 0){
diff -r b3647f81f4f6 kern/devfs-win32.c
--- a/kern/devfs-win32.c Tue Mar 20 03:45:36 2018 -0500
+++ b/kern/devfs-win32.c Tue Apr 17 10:17:35 2018 +0100
@@ -423,7 +423,7 @@
	if(perm & DMDIR) {
		wchar_t *p;
		DIR *d;
- if(m || t!=TPATH_FILE)
+ if(m || t==TPATH_ROOT)
			error(Eperm);
		if(!CreateDirectory(newpath, NULL))
			oserror();
diff -r b3647f81f4f6 kern/devip-win32.c
--- a/kern/devip-win32.c Tue Mar 20 03:45:36 2018 -0500
+++ b/kern/devip-win32.c Tue Apr 17 10:17:35 2018 +0100
@@ -1,3 +1,4 @@
+#define _WIN32_WINNT 0x0501
 #include <winsock2.h>
 #include <windows.h>
 #include <ws2tcpip.h>
@@ -215,7 +216,7 @@
 so_gethostbyname(char *host, char **hostv, int n)
 {
	char buf[INET6_ADDRSTRLEN];
- PADDRINFOA r, p;
+ struct addrinfo *r, *p;
	DWORD l;
	int i;

diff -r b3647f81f4f6 kern/win32.c
--- a/kern/win32.c Tue Mar 20 03:45:36 2018 -0500
+++ b/kern/win32.c Tue Apr 17 10:17:35 2018 +0100
@@ -126,12 +126,16 @@
	ReleaseSemaphore(op->sema, 1, 0);
 }

-#define RtlGenRandom SystemFunction036
-BOOLEAN WINAPI RtlGenRandom(PVOID, ULONG);
+BOOLEAN WINAPI (*RtlGenRandom)(PVOID, ULONG);

 void
 randominit(void)
 {
+ HMODULE mod;
+
+ mod = LoadLibraryW(L"ADVAPI32.DLL");
+ if(mod != NULL)
+ RtlGenRandom = (void *) GetProcAddress(mod, "SystemFunction036");
 }

 ulong


Mon Apr 16 22:38:15 EDT 2018
paul ryan

next