Skip to content

Instantly share code, notes, and snippets.

@gazhikaba
gazhikaba / WSL2_VPN_Workaround_Instructions.md
Created May 23, 2022 07:56 — forked from machuu/WSL2_VPN_Workaround_Instructions.md
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active. The workaround breaks down into two problems:

  1. Network connection to internet
  2. DNS in WSL2

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

// http://stackoverflow.com/a/4033310/6065417
// You can use functions provided by the hosting environment through javascript:
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
xmlHttp.send( null );
return xmlHttp.responseText;
要在COBOL中使用文件,要在3个不同的部中放上信息。
环境部,要有程序使用的每个文件的文件控制项目(FILE-CONTROL)。这个项目将程序中使用的文件名与程序外的实际文件联系起来。这些项目还定义文件的组织和访问方式。
数据部,要有每个文件的文件描述符(FD)项目,就是数据定义。
过程部,放上处理语句,OPEN,READ,WRITE,DELETE等。
环境部中主要是FILE-CONTROL和I-O-CONTROL.I-O-CONTROL很少使用。
SELECT [OPTIONAL] file-name ASSIGN TO DEV/FILE
[RESERVE N [AREA/AREAS]]
[FILE STATUS IS VAR]
SELECT必须是第一句,其他顺序无关。file-name是程序中传递使用的文件名,相当于实际文件的一个别名。OPTIONAL用于执行可能不存在的文件。
//output error message of code
declare
begin
DBMS_OUTPUT.PUT_LINE( sqlerrm(-904));
end;
@gazhikaba
gazhikaba / 0010
Last active June 13, 2016 12:32
Windows
net statistics workstation
.LineSeparator
Function SJIS_to_UTF8(FN As String)
引数「FN」にファイルのフルパスを入れます。
Dim FROM_OBJ As Object
Dim TO_OBJ As Object
@gazhikaba
gazhikaba / 000 CentOS.md
Last active April 19, 2018 06:37
Linux - CentOS
  1. VirtualBox CentOS network setting
  2. Error "Cannot retrieve metalink for repository: epel"
  3. Install apache php in centos 6
  4. Install mod_ssl to httpd on centos 6
  5. about iptables
  6. How to use shell paramter
  7. Increase disk size
  8. specify ssh key for a server
  9. Free memory
  10. check connection
@gazhikaba
gazhikaba / Resize VDI
Created April 14, 2016 07:53
Virtual box
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd "path/file.vdi" --resize 20480

001 Black&White

@gazhikaba
gazhikaba / 000 Note of java.md
Last active April 12, 2018 08:09
Note of JAVA
  1. Get system environment: System.getenv(String).
  2. Object <-> file.
  3. Access class varible by name.
  4. Comm.java Commom class. * print methods * Read file line(word) by line(word) to list with java.util.Scanner.