git config --global core.eol lf
git config --global core.autocrlf input
Make sure all local files are recreated with the correct line-endings
iptables -P INPUT ACCEPT && \ | |
iptables -P FORWARD ACCEPT && \ | |
iptables -P OUTPUT ACCEPT && \ | |
iptables -F INPUT && \ | |
iptables -F OUTPUT && \ | |
iptables -F FORWARD && \ | |
iptables -F && \ | |
iptables -t nat -F && \ | |
iptables -t mangle -F && \ | |
iptables -X && \ |
$ whoami | |
root | |
$ tshark | |
tshark: Couldn't run /usr/sbin/dumpcap in child process: Operation not permitted | |
Are you a member of the 'wireshark' group? Try running | |
'usermod -a -G wireshark _your_username_' as root. | |
$ stat $(which dumpcap) | |
File: '/usr/sbin/dumpcap' |
import groovy.sql.Sql | |
def dbUrl = "jdbc:postgresql://localhost/test-db" | |
def dbUser = "test" | |
def dbPassword = "test" | |
def dbDriver = "org.postgresql.Driver" | |
def sql = Sql.newInstance(dbUrl, dbUser, dbPassword, dbDriver) |
at java.net.SocketInputStream.socketRead0(java.base@11.0.17/Native Method)
at java.net.SocketInputStream.socketRead(java.base@11.0.17/SocketInputStream.java:115)
at java.net.SocketInputStream.read(java.base@11.0.17/SocketInputStream.java:168)
at java.net.SocketInputStream.read(java.base@11.0.17/SocketInputStream.java:140)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:1023)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:1013)
at sun.security.ssl.SSLSocketInputRecord.read(java.base@11.0.17/SSLSocketInputRecord.java:478)
at sun.security.ssl.SSLSocketInputRecord.readHeader(java.base@11.0.17/SSLSocketInputRecord.java:472)
# docker run
-e "JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" \
-p 5005:5005
# docker-compose
environment:
- "JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
ports:
- 5005:5005
class Node { | |
constructor(name, childNodes) { | |
this.name = name; | |
this.childNodes = childNodes; | |
this.visited = false; | |
} | |
} | |
function *dfs(u) { | |
u.visited = true; |
yum --enablerepo=base-debuginfo install -y kernel-debuginfo-$(uname -r) |
$ jmap -heap 66 | |
Attaching to process ID 66, please wait... | |
Debugger attached successfully. | |
Server compiler detected. | |
JVM version is 25.111-b14 | |
using parallel threads in the new generation. | |
using thread-local object allocation. | |
Concurrent Mark-Sweep GC |
A delicate matter, requiring taste and judgement. I tend to err on the side of eliminating comments, for several reasons. First, if the code is clear, and uses good type names and variable names, it should explain itself. Second, comments aren't checked by the compiler, so there is no guarantee they're right, especially after the code is modified. A misleading comment can be very confusing. Third, the issue of typography: comments clutter code.
Rob Pike, "Notes on Programming in C"