- Docker
** Prepare docker
*** install docker package
*** start and enable service
sudo systemctl start docker.service
sudo systemctl enable docker.service
** add permission and groupsudo usermod -aG docker $USER
** reboot your computer ** check if docker works
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
find the files containing the obsolete: | |
such as assoc: | |
find ~/.emacs.d/ -name "*.el" -exec grep -H "(require 'assoc)" {} \; | |
# for the differences of cscope ctags, etags, global(gtags, ggtags..)...: | |
# https://github.com/OpenGrok/OpenGrok/wiki/Comparison-with-Similar-Tools | |
# etags for small c;cscope for big project |
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
https://unix.stackexchange.com/a/536056/22322 | |
To get Auto-Resize Guest Display working you have to use 'VBoxVGA' | |
Stop VM if installed and running | |
Choose in VM Setting: Display > Screen > Graphics Controller > 'VBoxVGA' | |
Save | |
Start VM with Manjaro - Screen goes black. | |
hit CTRL+ALT+F2 to enter tty2 | |
logon |
Sources:
- https://www.youtube.com/watch?v=QMBE5Kxb8Bg
- https://www.youtube.com/watch?v=a00wbjy2vns
- https://www.youtube.com/watch?v=jLJO-PKyDAk
- Burn the ISO into USB drive if installing it into drive directly
dd if=archlinux.iso of=/dev/sda bs=4M status=progress && sync
- Install
libvirt ovmf
packages and reboot if installing it into KVM NOTE: ovmf package and reboot step ensure that boot from UEFI instead of BIOS, otherwise, it would fail during the process when you try togrub-install
(install bootloader)
- choose Fireware of "UEFI x86_84: ... OVMF_CODE.fd" from Overview in VM details of KVM
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
* Create tig appimage | |
** get tig src file zip or using git into ~/public/tig | |
** compile | |
- make | |
- fix the dependencies | |
** generate the appimage file | |
- download linuxdeploy appimage and make it executable | |
- write the right tig.desktop and log tig.png, the logo can be empty tig.svg file | |
- ./linuxdeploy.appimage -e ./src/tig -i ./tig.png -d ./tig.desktop --appdir AppDir --output appimage | |
+ NOTE: in docker, you may unable to run appimage directly |
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
# 141. Linked List Cycle (Easy) | |
# https://leetcode-cn.com/problems/linked-list-cycle/description/ | |
# Definition for singly-linked list. | |
class ListNode: | |
def __init__(self, x): | |
self.val = x | |
self.next = None | |
class Solution: |
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
# 88. Merge Sorted Array (Easy) | |
# https://leetcode-cn.com/problems/merge-sorted-array/description/ | |
from typing import List | |
class Solution: | |
def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None: | |
""" | |
Do not return anything, modify nums1 in-place instead. | |
""" |
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
# 680. Valid Palindrome II (Easy) | |
# https://leetcode-cn.com/problems/valid-palindrome-ii/description/ | |
class Solution: | |
def validPalindrome(self, s): | |
if s == s[::-1]: | |
return True | |
l, r = 0, len(s) - 1 | |
while l < r: | |
if s[l] == s[r]: | |
l, r = l + 1, r - 1 |
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
# https://cyc2018.github.io/CS-Notes/#/notes/32.1%20%E4%BB%8E%E4%B8%8A%E5%BE%80%E4%B8%8B%E6%89%93%E5%8D%B0%E4%BA%8C%E5%8F%89%E6%A0%91 | |
class Node: | |
def __init__(self, val=0): | |
self.val = val | |
self.left = None | |
self.right = None | |
class TreeNodes: | |
def __init__(self): |
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
#!/usr/bin/env python3 | |
# https://cyc2018.github.io/CS-Notes/#/notes/29.%20%E9%A1%BA%E6%97%B6%E9%92%88%E6%89%93%E5%8D%B0%E7%9F%A9%E9%98%B5 | |
class Solution: | |
def printMatrix(self, matrix): | |
res = [] | |
while matrix: | |
res += matrix.pop(0) | |
if matrix and matrix[0]: | |
for row in matrix: |
NewerOlder