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
PS1='$ ' | |
echo -e '\033]0; \007' |
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
socat -d -d pty,raw,echo=0 pty,raw,echo=0 |
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
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0 }" |
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
ip link add name A type veth peer name B | |
ip addr add 10.0.0.1/24 dev A | |
ip link set A up | |
ip netns add myns | |
ip link set B netns myns | |
ip netns exec myns ip addr add 10.0.0.2/24 dev B | |
ip netns exec myns ip link set B up |
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
#define _XOPEN_SOURCE | |
#include <time.h> | |
#include <stdio.h> | |
// Simple-task-30036777 | |
int main() { | |
char buf[] = "2021-04-28T21:29:10.279Z"; | |
int len; | |
struct tm tmbuf; | |
char *c = NULL; |
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
# -lossless | |
# create a lossless image | |
# you can use '-z 9' to really make a small image, | |
# but my tests show that it only produces around 1% better compression rate, | |
# with much longer compression times | |
# | |
# -resize 1080 1920 | |
# (optional) resize the image | |
cwebp -lossless -resize 1080 1920 image.png -o image.webp |
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
# -crop 2250x1518+0+0 | |
# crop the image to 2250x1518 | |
# without this, the image will be resized to | |
# - 800x541, if using the geometry transform | |
# - 799x540, if using the resize transform | |
# | |
# +repage | |
# reset the virtual canvas to the image size, which has been cropped | |
# | |
# -geometry 800 |
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
# image.png: image file | |
# video.mp4: video file | |
# -t 5: video duration in seconds | |
# -crf 20: (optional) compression, higher value higher compression rate and lower video quality | |
# using -crf 0 (lossless) sometimes leads to glitches, use -crf 1 for best results | |
# note: the order of the arguments matter | |
ffmpeg -loop 1 -i image.png -t 5 -crf 20 -vcodec libx264 -pix_fmt yuv420p video.mp4 |
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
# Replace 'adb' with the desired process name | |
ps -o pid,args `pidof adb` |
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
Sometimes `apt upgrade` says "... packages have been kept back:". | |
To see the decision making: | |
``` | |
$ sudo apt upgrade -oDebug::pkgProblemResolver=1 | |
``` |
OlderNewer