dnrops.gitlink.net/posts/linux/command_list.html

1265 lines
77 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML>
<html lang="en" class="coal" dir="ltr">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>command list - Andrew&#x27;s Blog</title>
<!-- Custom HTML head -->
<meta name="description" content="Andrew Ryan&#x27;s Blog">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="../../favicon.svg">
<link rel="shortcut icon" href="../../favicon.png">
<link rel="stylesheet" href="../../css/variables.css">
<link rel="stylesheet" href="../../css/general.css">
<link rel="stylesheet" href="../../css/chrome.css">
<!-- Fonts -->
<link rel="stylesheet" href="../../FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="../../fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="../../highlight.css">
<link rel="stylesheet" href="../../tomorrow-night.css">
<link rel="stylesheet" href="../../ayu-highlight.css">
<!-- Custom theme stylesheets -->
<link rel="stylesheet" href="../../src/style/custom.css">
<!-- MathJax -->
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body class="sidebar-visible no-js">
<div id="body-container">
<!-- Provide site root to javascript -->
<script>
var path_to_root = "../../";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "coal" : "coal";
</script>
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script>
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script>
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var html = document.querySelector('html');
html.classList.remove('coal')
html.classList.add(theme);
var body = document.querySelector('body');
body.classList.remove('no-js')
body.classList.add('js');
</script>
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
<!-- Hide / unhide sidebar before it is displayed -->
<script>
var body = document.querySelector('body');
var sidebar = null;
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
} else {
sidebar = 'hidden';
}
sidebar_toggle.checked = sidebar === 'visible';
body.classList.remove('sidebar-visible');
body.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item affix "><a href="../../index.html">Andrew's Blog</a></li><li class="chapter-item expanded "><a href="../../posts/linux/linux.html"><strong aria-hidden="true">1.</strong> linux</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/linux/install_linux.html"><strong aria-hidden="true">1.1.</strong> install linux</a></li><li class="chapter-item "><a href="../../posts/linux/bash_profile.html"><strong aria-hidden="true">1.2.</strong> bash profile</a></li><li class="chapter-item expanded "><a href="../../posts/linux/command_list.html" class="active"><strong aria-hidden="true">1.3.</strong> command list</a></li><li class="chapter-item "><a href="../../posts/linux/git_guide.html"><strong aria-hidden="true">1.4.</strong> git guide</a></li><li class="chapter-item "><a href="../../posts/linux/tar.html"><strong aria-hidden="true">1.5.</strong> tar</a></li><li class="chapter-item "><a href="../../posts/linux/run_x86_elf_in_x64_setup.html"><strong aria-hidden="true">1.6.</strong> run x86 elf in x64 setup</a></li></ol></li><li class="chapter-item "><a href="../../posts/mac/mac.html"><strong aria-hidden="true">2.</strong> mac</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/mac/macos_profiles.html"><strong aria-hidden="true">2.1.</strong> macos profiles</a></li></ol></li><li class="chapter-item "><a href="../../posts/swift/swift.html"><strong aria-hidden="true">3.</strong> swift</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/swift/learn_swift.html"><strong aria-hidden="true">3.1.</strong> learn swift basics</a></li><li class="chapter-item "><a href="../../posts/swift/swift_extensions.html"><strong aria-hidden="true">3.2.</strong> Swift extensions</a></li><li class="chapter-item "><a href="../../posts/swift/swiftui_extension.html"><strong aria-hidden="true">3.3.</strong> SwiftUI extensions</a></li><li class="chapter-item "><a href="../../posts/swift/install_swift.html"><strong aria-hidden="true">3.4.</strong> install swift</a></li><li class="chapter-item "><a href="../../posts/swift/task_planner.html"><strong aria-hidden="true">3.5.</strong> implment task panner app with SwiftUI</a></li><li class="chapter-item "><a href="../../posts/swift/swift_cheat_sheet.html"><strong aria-hidden="true">3.6.</strong> Swift Cheat Sheet</a></li><li class="chapter-item "><a href="../../posts/swift/yinci_url.html"><strong aria-hidden="true">3.7.</strong> Personal privacy protocol</a></li><li class="chapter-item "><a href="../../posts/swift/swift_regular_exressions.html"><strong aria-hidden="true">3.8.</strong> Swift regular exressions</a></li><li class="chapter-item "><a href="../../posts/ios/how_to_create_beautiful_ios_charts_in_swift.html"><strong aria-hidden="true">3.9.</strong> How to Create Beautiful iOS Charts in鑱絊wift</a></li><li class="chapter-item "><a href="../../posts/swift/swiftui_source_code.html"><strong aria-hidden="true">3.10.</strong> SwiftUI source code</a></li><li class="chapter-item "><a href="../../posts/swift/use_swift_fetch_iciba_api.html"><strong aria-hidden="true">3.11.</strong> use swift fetch iciba API</a></li></ol></li><li class="chapter-item "><a href="../../posts/ios/ios.html"><strong aria-hidden="true">4.</strong> ios</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/ios/cocaposd_setup_and_install_for_ios_project.html"><strong aria-hidden="true">4.1.</strong> cocaposd setup and install for ios project</a></li><li class="chapter-item "><a href="../../posts/ios/swiftui_show_gif_image.html"><strong aria-hidden="true">4.2.</strong> SwiftUI show gif image</a></li><li class="chapter-item "><a href="../../posts/ios/implement_task_planner_app.html"><strong aria-hidden="true">4.3.</strong> implement Task planner App</a></li></ol></li><li class="chapter-item "><a href="../../posts/objective_c/objective_c.html"><strong aria-hidden="true">5.</strong> objective_c</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/objective_c/objective_c_cheat_sheet.html"><strong aria-hidden="true">5.1.</strong> Objective-C Cheat Sheet</a></li><li class="chapter-item "><a href="../../posts/objective_c/objective_c_for_absolute_beginners_read_note.html"><strong aria-hidden="true">5.2.</strong> Objective-C Note</a></li></ol></li><li class="chapter-item "><a href="../../posts/dart/dart.html"><strong aria-hidden="true">6.</strong> dart</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/dart/flutter.html"><strong aria-hidden="true">6.1.</strong> Flutter Cheat Sheet</a></li><li class="chapter-item "><a href="../../posts/dart/dart_cheat_sheet.html"><strong aria-hidden="true">6.2.</strong> Dart Cheat Sheet</a></li><li class="chapter-item "><a href="../../posts/flutter/flutter_dev_test.html"><strong aria-hidden="true">6.3.</strong> Flutter dev test</a></li></ol></li><li class="chapter-item "><a href="../../posts/rust/rust.html"><strong aria-hidden="true">7.</strong> rust</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/rust/offline_use_rust.html"><strong aria-hidden="true">7.1.</strong> Offline use rust</a></li><li class="chapter-item "><a href="../../posts/rust/rust_grammer.html"><strong aria-hidden="true">7.2.</strong> rust grammar</a></li><li class="chapter-item "><a href="../../posts/rust/pase_string_and_decimal_conversion.html"><strong aria-hidden="true">7.3.</strong> pase string and decimal conversion</a></li><li class="chapter-item "><a href="../../posts/rust/parse_types.html"><strong aria-hidden="true">7.4.</strong> rust types</a></li><li class="chapter-item "><a href="../../posts/rust/rust_life_cycle.html"><strong aria-hidden="true">7.5.</strong> Rust life cycle</a></li><li class="chapter-item "><a href="../../posts/rust/rust_generic.html"><strong aria-hidden="true">7.6.</strong> rust generics</a></li><li class="chapter-item "><a href="../../posts/rust/rust_implment_matrix.html"><strong aria-hidden="true">7.7.</strong> Rust implement matrix</a></li><li class="chapter-item "><a href="../../posts/rust/rust_sort.html"><strong aria-hidden="true">7.8.</strong> Rust implement sort algorithms</a></li><li class="chapter-item "><a href="../../posts/rust/implement_aes_encryption.html"><strong aria-hidden="true">7.9.</strong> Rust implement AEC encryption and decryption</a></li><li class="chapter-item "><a href="../../posts/rust/implement_trie_data_structure.html"><strong aria-hidden="true">7.10.</strong> implement trie data structure</a></li><li class="chapter-item "><a href="../../posts/rust/rust_implement_tree.html"><strong aria-hidden="true">7.11.</strong> implement tree data_structure</a></li><li class="chapter-item "><a href="../../posts/rust/list_dir.html"><strong aria-hidden="true">7.12.</strong> list dir</a></li><li class="chapter-item "><a href="../../posts/rust/fast_way_to_implment_object_trait.html"><strong aria-hidden="true">7.13.</strong> fast way to implment object trait</a></li><li class="chapter-item "><a href="../../posts/rust/compress_rust_binary_size.html"><strong aria-hidden="true">7.14.</strong> compress rust binary size</a></li><li class="chapter-item "><a href="../../posts/rust/implment_file_upload_backend.html"><strong aria-hidden="true">7.15.</strong> impliment file upload</a></li><li class="chapter-item "><a href="../../posts/rust/this_is_add_post_cli_implementation_in_rust.html"><strong aria-hidden="true">7.16.</strong> this is add_post cli implementation in rust</a></li><li class="chapter-item "><a href="../../posts/rust/use_rust_implment_a_copyclipbord_cli.html"><strong aria-hidden="true">7.17.</strong> Use rust implment a copyclipbord CLI</a></li><li class="chapter-item "><a href="../../posts/rust/sqlite_database_add_delete_update_show_in_rust.html"><strong aria-hidden="true">7.18.</strong> sqlite database add delete update show in rust</a></li><li class="chapter-item "><a href="../../posts/rust/implementing_tokio_joinhandle_for_wasm.html"><strong aria-hidden="true">7.19.</strong> Implementing tokio JoinHandle for wasm</a></li><li class="chapter-item "><a href="../../posts/rust/rust_implement_a_crate_for_encode_and_decode_brainfuck_and_ook.html"><strong aria-hidden="true">7.20.</strong> rust implement a crate for encode and decode brainfuck and ook</a></li><li class="chapter-item "><a href="../../posts/rust/slint_builtin_elements.html"><strong aria-hidden="true">7.21.</strong> Slint Builtin Elements</a></li><li class="chapter-item "><a href="../../posts/rust/corporate_network_install_rust_on_windows.html"><strong aria-hidden="true">7.22.</strong> Corporate network install Rust on windows</a></li><li class="chapter-item "><a href="../../posts/rust/rust_binary_file_how_to_judge_static_link_or_dynamic_link_in_macos.html"><strong aria-hidden="true">7.23.</strong> rust binary file how to judge static link or dynamic link in Macos</a></li><li class="chapter-item "><a href="../../posts/rust/rust_binary_include_dir_and_get_contents.html"><strong aria-hidden="true">7.24.</strong> rust binary include dir and get contents</a></li><li class="chapter-item "><a href="../../posts/rust/rust_logger_non-block.html"><strong aria-hidden="true">7.25.</strong> rust logger non-block</a></li><li class="chapter-item "><a href="../../posts/rust/rust_connect_sql_server_database.html"><strong aria-hidden="true">7.26.</strong> rust connect sql server database</a></li><li class="chapter-item "><a href="../../posts/rust/rust_websocket_implment.html"><strong aria-hidden="true">7.27.</strong> rust websocket implment</a></li></ol></li><li class="chapter-item "><a href="../../posts/java/java.html"><strong aria-hidden="true">8.</strong> java</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/java/java_grammar.html"><strong aria-hidden="true">8.1.</strong> java grammar and codewar</a></li><li class="chapter-item "><a href="../../posts/java/run_jar.html"><strong aria-hidden="true">8.2.</strong> java run .jar</a></li><li class="chapter-item "><a href="../../posts/java/java_pomxml_add_defaultgoal_to_build.html"><strong aria-hidden="true">8.3.</strong> Java pomxml add defaultGoal to build</a></li><li class="chapter-item "><a href="../../posts/java/java_set_mvn_mirror.html"><strong aria-hidden="true">8.4.</strong> Java set mvn mirror</a></li></ol></li><li class="chapter-item "><a href="../../posts/python/python.html"><strong aria-hidden="true">9.</strong> python</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/python/convert_pesn.html"><strong aria-hidden="true">9.1.</strong> convert pesn</a></li><li class="chapter-item "><a href="../../posts/python/find_remove_dir.html"><strong aria-hidden="true">9.2.</strong> find and remove dir</a></li><li class="chapter-item "><a href="../../posts/python/timing_message.html"><strong aria-hidden="true">9.3.</strong> wechat send message</a></li><li class="chapter-item "><a href="../../posts/python/use_python_openpyxl_package_read_and_edit_excel_files.html"><strong aria-hidden="true">9.4.</strong> Use python openpyxl package read and edit excel files</a></li></ol></li><li class="chapter-item "><a href="../../posts/go/go.html"><strong aria-hidden="true">10.</strong> go</a></li><li class="chapter-item "><a href="../../posts/js/js.html"><strong aria-hidden="true">11.</strong> js</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/js/js_tutorial.html"><strong aria-hidden="true">11.1.</strong> js tutorial</a></li><li class="chapter-item "><a href="../../posts/js/js_tutorial_map.html"><strong aria-hidden="true">11.2.</strong> ja map</a></li><li class="chapter-item "><a href="../../posts/js/js_tutorial_math.html"><strong aria-hidden="true">11.3.</strong> js math</a></li><li class="chapter-item "><a href="../../posts/js/js_tutorial_object.html"><strong aria-hidden="true">11.4.</strong> js object</a></li><li class="chapter-item "><a href="../../posts/js/js_tutorial_set.html"><strong aria-hidden="true">11.5.</strong> js set</a></li><li class="chapter-item "><a href="../../posts/js/single_thread_and_asynchronous.html"><strong aria-hidden="true">11.6.</strong> single thread and asynchronous</a></li><li class="chapter-item "><a href="../../posts/js/this.html"><strong aria-hidden="true">11.7.</strong> js this</a></li><li class="chapter-item "><a href="../../posts/js/js_implment_aes.html"><strong aria-hidden="true">11.8.</strong> js implment aes</a></li><li class="chapter-item "><a href="../../posts/js/getting_started_with_ajax.html"><strong aria-hidden="true">11.9.</strong> getting started with ajax</a></li><li class="chapter-item "><a href="../../posts/js/BinarySearchTree.html"><strong aria-hidden="true">11.10.</strong> binary search tree</a></li><li class="chapter-item "><a href="../../posts/js/goole_zx.html"><strong aria-hidden="true">11.11.</strong> goole zx</a></li><li class="chapter-item "><a href="../../posts/js/es6.html"><strong aria-hidden="true">11.12.</strong> es6</a></li></ol></li><li class="chapter-item "><a href="../../posts/ruby/ruby.html"><strong aria-hidden="true">12.</strong> ruby</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/ruby/rails_setup_env.html"><strong aria-hidden="true">12.1.</strong> ruby on rails setup environment</a></li><li class="chapter-item "><a href="../../posts/ruby/learn_ruby.html"><strong aria-hidden="true">12.2.</strong> learn ruby</a></li><li class="chapter-item "><a href="../../posts/ruby/ruby_note.html"><strong aria-hidden="true">12.3.</strong> Ruby Note</a></li><li class="chapter-item "><a href="../../posts/ruby/setup_ruby_for_ctf.html"><strong aria-hidden="true">12.4.</strong> Setup ruby for CTF</a></li></ol></li><li class="chapter-item "><a href="../../posts/react/react.html"><strong aria-hidden="true">13.</strong> react</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/react/react_life_cycle.html"><strong aria-hidden="true">13.1.</strong> react life cycle</a></li><li class="chapter-item "><a href="../../posts/react/react_router.html"><strong aria-hidden="true">13.2.</strong> react router</a></li><li class="chapter-item "><a href="../../posts/react/react_this.html"><strong aria-hidden="true">13.3.</strong> react this</a></li><li class="chapter-item "><a href="../../posts/react/react_interviw.html"><strong aria-hidden="true">13.4.</strong> react interview</a></li><li class="chapter-item "><a href="../../posts/react/important_react_interview.html"><strong aria-hidden="true">13.5.</strong> important react interview</a></li><li class="chapter-item "><a href="../../posts/react/react_quick_reference.html"><strong aria-hidden="true">13.6.</strong> react quick reference</a></li><li class="chapter-item "><a href="../../posts/react/redux_quick_reference.html"><strong aria-hidden="true">13.7.</strong> redux quick reference</a></li></ol></li><li class="chapter-item "><a href="../../posts/vue/vue.html"><strong aria-hidden="true">14.</strong> vue</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/vue/vue_ajax.html"><strong aria-hidden="true">14.1.</strong> vue ajax</a></li></ol></li><li class="chapter-item "><a href="../../posts/angular/angular.html"><strong aria-hidden="true">15.</strong> angular</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/angular/controller_communication.html"><strong aria-hidden="true">15.1.</strong> controller communication</a></li><li class="chapter-item "><a href="../../posts/angular/creating_custom_directives.html"><strong aria-hidden="true">15.2.</strong> creating custom directives</a></li><li class="chapter-item "><a href="../../posts/angular/directive_notes.html"><strong aria-hidden="true">15.3.</strong> directive notes</a></li><li class="chapter-item "><a href="../../posts/angular/directive_communication.html"><strong aria-hidden="true">15.4.</strong> directive communication</a></li><li class="chapter-item "><a href="../../posts/angular/post_params.html"><strong aria-hidden="true">15.5.</strong> post params</a></li><li class="chapter-item "><a href="../../posts/angular/read_json_angular.html"><strong aria-hidden="true">15.6.</strong> read json angular</a></li><li class="chapter-item "><a href="../../posts/angular/same_route_reload.html"><strong aria-hidden="true">15.7.</strong> same route reload</a></li></ol></li><li class="chapter-item "><a href="../../posts/css/css.html"><strong aria-hidden="true">16.</strong> css</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/css/use_css_media.html"><strong aria-hidden="true">16.1.</strong> use css media</a></li></ol></li><li class="chapter-item "><a href="../../posts/php/php.html"><strong aria-hidden="true">17.</strong> php</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/php/for_php_string_implment_some_extemtion_functions.html"><strong aria-hidden="true">17.1.</strong> for php string implment some extemtion functions</a></li><li class="chapter-item "><a href="../../posts/php/php_cheatsheet.html"><strong aria-hidden="true">17.2.</strong> PHP cheatsheet</a></li></ol></li><li class="chapter-item "><a href="../../posts/leetcode/leetcode.html"><strong aria-hidden="true">18.</strong> leetcode</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/leetcode/rust_leetcode.html"><strong aria-hidden="true">18.1.</strong> rust leetcode</a></li><li class="chapter-item "><a href="../../posts/leetcode/rust_codewar.html"><strong aria-hidden="true">18.2.</strong> rust codewar</a></li><li class="chapter-item "><a href="../../posts/leetcode/swift_codewar.html"><strong aria-hidden="true">18.3.</strong> swift codewar</a></li><li class="chapter-item "><a href="../../posts/leetcode/js_leetcode.html"><strong aria-hidden="true">18.4.</strong> js leetcode</a></li><li class="chapter-item "><a href="../../posts/leetcode/java_leetcode.html"><strong aria-hidden="true">18.5.</strong> java leetcode</a></li><li class="chapter-item "><a href="../../posts/leetcode/rust_huawei.html"><strong aria-hidden="true">18.6.</strong> huawei test</a></li><li class="chapter-item "><a href="../../posts/leetcode/rust_utils.html"><strong aria-hidden="true">18.7.</strong> rust common functions</a></li><li class="chapter-item "><a href="../../posts/leetcode/olympiad_training.html"><strong aria-hidden="true">18.8.</strong> Computer olympiad training</a></li></ol></li><li class="chapter-item "><a href="../../posts/ctf/CTF.html"><strong aria-hidden="true">19.</strong> ctf</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../posts/ctf/CTF_Note.html"><strong aria-hidden="true">19.1.</strong> CTF Note</a></li><li class="chapter-item "><a href="../../posts/ctf/0.1_Web.html"><strong aria-hidden="true">19.2.</strong> Web</a></li><li class="chapter-item "><a href="../../posts/ctf/4.1_Misc.html"><strong aria-hidden="true">19.3.</strong> Misc</a></li><li class="chapter-item "><a href="../../posts/ctf/3.2_PWN_note.html"><strong aria-hidden="true">19.4.</strong> PWN</a></li><li class="chapter-item "><a href="../../posts/ctf/3.1_Crypto.html"><strong aria-hidden="true">19.5.</strong> Crypto</a></li><li class="chapter-item "><a href="../../posts/ctf/3.4_RSA_note.html"><strong aria-hidden="true">19.6.</strong> Rsa attack</a></li><li class="chapter-item "><a href="../../posts/ctf/3.5_Base64.html"><strong aria-hidden="true">19.7.</strong> Base64</a></li><li class="chapter-item "><a href="../../posts/ctf/0.0_SQL Injection Cheatsheet.html"><strong aria-hidden="true">19.8.</strong> SQL Injection Cheatsheet</a></li><li class="chapter-item "><a href="../../posts/ctf/1.1_SQL_injection.html"><strong aria-hidden="true">19.9.</strong> SQL Injection</a></li><li class="chapter-item "><a href="../../posts/ctf/1.2_SQL_injection_UNION_attacks.html"><strong aria-hidden="true">19.10.</strong> SQL Injection UNION attacks</a></li><li class="chapter-item "><a href="../../posts/ctf/1.3_Blind SQL injection.html"><strong aria-hidden="true">19.11.</strong> Blind SQL Injection</a></li><li class="chapter-item "><a href="../../posts/ctf/1.4_Code Injection.html"><strong aria-hidden="true">19.12.</strong> Code Injection</a></li><li class="chapter-item "><a href="../../posts/ctf/1.5_SSRF.html"><strong aria-hidden="true">19.13.</strong> SSRF</a></li><li class="chapter-item "><a href="../../posts/ctf/1.6_OS command injection.html"><strong aria-hidden="true">19.14.</strong> OS command injection</a></li><li class="chapter-item "><a href="../../posts/ctf/1.7_Local file inclusion.html"><strong aria-hidden="true">19.15.</strong> Local file inclusion</a></li><li class="chapter-item "><a href="../../posts/ctf/1.8_Remote file inclusion.html"><strong aria-hidden="true">19.16.</strong> Remote file inclusion</a></li><li class="chapter-item "><a href="../../posts/ctf/1.9_CSRFm.html"><strong aria-hidden="true">19.17.</strong> CSRF</a></li><li class="chapter-item "><a href="../../posts/ctf/1.10_NoSQL injection.html"><strong aria-hidden="true">19.18.</strong> NoSQL injection</a></li><li class="chapter-item "><a href="../../posts/ctf/1.11_JSON injection.html"><strong aria-hidden="true">19.19.</strong> JSON injection</a></li><li class="chapter-item "><a href="../../posts/ctf/1.12_CTF_Web_SQL_Note.html"><strong aria-hidden="true">19.20.</strong> CTF Web SQL Note</a></li><li class="chapter-item "><a href="../../posts/ctf/2.1_XXE.html"><strong aria-hidden="true">19.21.</strong> XXE</a></li><li class="chapter-item "><a href="../../posts/ctf/2.2_XSS.html"><strong aria-hidden="true">19.22.</strong> XSS</a></li><li class="chapter-item "><a href="../../posts/ctf/2.3_Upload File.html"><strong aria-hidden="true">19.23.</strong> Upload File</a></li><li class="chapter-item "><a href="../../posts/ctf/2.4_serialize_unserialize.html"><strong aria-hidden="true">19.24.</strong> serialize unserialize</a></li><li class="chapter-item "><a href="../../posts/ctf/2.5_Race condition.html"><strong aria-hidden="true">19.25.</strong> Race condition</a></li><li class="chapter-item "><a href="../../posts/ctf/3.2_PWN_note.html"><strong aria-hidden="true">19.26.</strong> PWN_note</a></li><li class="chapter-item "><a href="../../posts/ctf/3.3_pwn HCTF2016 brop.html"><strong aria-hidden="true">19.27.</strong> pwn HCTF2016 brop</a></li><li class="chapter-item "><a href="../../posts/ctf/pwn_patch_defense_skill.html"><strong aria-hidden="true">19.28.</strong> PWN Patch defense skill</a></li><li class="chapter-item "><a href="../../posts/ctf/pwn_stack_overflow.html"><strong aria-hidden="true">19.29.</strong> PWN stack overflow</a></li><li class="chapter-item "><a href="../../posts/ctf/pwn_heap_overflow.html"><strong aria-hidden="true">19.30.</strong> PWN heap overflow</a></li><li class="chapter-item "><a href="../../posts/ctf/pwn_format_string_vulnerability.html"><strong aria-hidden="true">19.31.</strong> PWN Format String Vulnerability</a></li><li class="chapter-item "><a href="../../posts/ctf/kali_linux_tutorials.html"><strong aria-hidden="true">19.32.</strong> Kali linux tutorials</a></li><li class="chapter-item "><a href="../../posts/ctf/google_dorks_2023_lists.html"><strong aria-hidden="true">19.33.</strong> Google Dorks 2023 Lists</a></li><li class="chapter-item "><a href="../../posts/ctf/dvwa_writeup.html"><strong aria-hidden="true">19.34.</strong> DVWA WriteUp</a></li><li class="chapter-item "><a href="../../posts/ctf/bwapp_writeup.html"><strong aria-hidden="true">19.35.</strong> bWAPP WriteUp</a></li><li class="chapter-item "><a href="../../posts/ctf/sqlilabs_writeup.html"><strong aria-hidden="true">19.36.</strong> sqlilabs WriteUp</a></li><li class="chapter-item "><a href="../../posts/ctf/ctf_train_at_hangzhou.html"><strong aria-hidden="true">19.37.</strong> ctf train at hangzhou</a></li><li class="chapter-item "><a href="../../posts/ctf/ctf_common_mindmap_list.html"><strong aria-hidden="true">19.38.</strong> ctf common mindmap list</a></li><li class="chapter-item "><a href="../../posts/ctf/error_based_sql_injection.html"><strong aria-hidden="true">19.39.</strong> Error Based SQL Injection</a></li><li class="chapter-item "><a href="../../posts/ctf/urlfinder_tutorial.html"><strong aria-hidden="true">19.40.</strong> URLFinder Tutorial</a></li><li class="chapter-item "><a href="../../posts/ctf/observer_ward_tutorial.html"><strong aria-hidden="true">19.41.</strong> observer_ward Tutorial</a></li><li class="chapter-item "><a href="../../posts/ctf/mysql_udf_.html"><strong aria-hidden="true">19.42.</strong> MySQL UDF 提权</a></li><li class="chapter-item "><a href="../../posts/ctf/nuclei__tutorial.html"><strong aria-hidden="true">19.43.</strong> Nuclei Tutorial</a></li><li class="chapter-item "><a href="../../posts/ctf/2024_ctf_solution_thinking.html"><strong aria-hidden="true">19.44.</strong> 2024 ctf solution thinking</a></li><li class="chapter-item "><a href="../../posts/ctf/man_che_si_te_bian_ma.html"><strong aria-hidden="true">19.45.</strong> 曼彻斯特编码</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>
<!-- Track and set sidebar scroll position -->
<script>
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
sidebarScrollbox.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
}
}, { passive: true });
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
sessionStorage.removeItem('sidebar-scroll');
if (sidebarScrollTop) {
// preserve sidebar scroll position when navigating via links within sidebar
sidebarScrollbox.scrollTop = sidebarScrollTop;
} else {
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
var activeSection = document.querySelector('#sidebar .active');
if (activeSection) {
activeSection.scrollIntoView({ block: 'center' });
}
}
</script>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</label>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">Andrew&#x27;s Blog</h1>
<div class="right-buttons">
<a href="https://gitlink.org.cn/dnrops/dnrops.gitlink.net.git" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa fa-github"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script>
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<main>
<h1 id="command-list"><a class="header" href="#command-list">command list</a></h1>
<h2 id=""><a class="header" href="#"></a></h2>
<pre><code class="language-sh">#conda activate:
source /opt/anaconda/bin/activate google
</code></pre>
<h2 id="commen-mysql-command"><a class="header" href="#commen-mysql-command">commen MySQL command</a></h2>
<pre><code class="language-sh">sql account and password
root@localhost: Ub&lt;%Jpueg56L
#Automatically enable mysql when system startup
sudo systemctl enable mysqld.service
#Start the MySQL service
sudo systemctl start mysqld.service
#View the MySQL service status
systemctl status mysqld.service
</code></pre>
<h2 id="labelme-manual"><a class="header" href="#labelme-manual">labelme manual</a></h2>
<pre><code class="language-sh">#activate anaconda
source /opt/anaconda/bin/activate google
# install labelme
pip install labelme
#open
lable
</code></pre>
<h2 id="use-ffmpeg"><a class="header" href="#use-ffmpeg">use ffmpeg</a></h2>
<pre><code class="language-sh">#ffmpeg merge videos
for f in *.mp4; do echo "file '$f'" &gt;&gt; files.txt; done
ffmpeg -f concat -i files.txt -c copy output.mp4
#ffmpeg merge audio
for f in *.mp3; do echo "file '$f'" &gt;&gt; files.txt; done
ffmpeg -f concat -i files.txt -c copy output.mp3
#cut video
#-ss start time
#-t duration
ffmpeg -ss 0:1:30 -t 0:0:20 -i input.avi -vcodec copy -acodec copy output.avi
#Video and audio encapsulation
ffmpeg i video_file.mp4 i audio_file.mp3 vcodec copy acodec copy output_file.mp4
#Separate video audio streams
ffmpeg -i input_file -vcodec copy -an output_file_video.mp4  #Separate the video stream
ffmpeg -i input_file -acodec copy -vn output_file_audio.mp3  #Separate the audio stream
#video demux(compress and decompress)
ffmpeg i test.mp4 vcodec copy an f m4v test.264
ffmpeg i test.avi vcodec copy an f m4v test.264
#Video transcoding
#Transcode to the original file of the stream
ffmpeg i test.mp4 vcodec h264 s 352*278 an f m4v test.264
#Transcode to the original file of the stream
#-bf B frame number control, -g key frame interval control, -s resolution control
ffmpeg i test.mp4 vcodec h264 bf 0 g 25 s 352*278 an f m4v test.264
#Transcode to an encapsulation file
ffmpeg i test.avi -vcodec mpeg4 vtag xvid qsame test_xvid.avi
#Convert videos to mp3
ffmpeg -i Bob_Proctor.mp4 -vn bob_proctor.mp3
#Replace audio in video with audio.wav audio
ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 output.mp4
#convert mov to mp4
ls *mov|while read id;do (ffmpeg -i "$id" -vcodec libx264 -preset fast -crf 20 -y -vf "scale=1920:-1" -acodec libmp3lame -ab 128k "${id%%.*}.mp4" );done
</code></pre>
<h2 id="dart-web-error-cannt-open-dart-web-serve"><a class="header" href="#dart-web-error-cannt-open-dart-web-serve">dart web error :Cannt open dart web serve</a></h2>
<pre><code class="language-sh">pub global activate webdev
webdev serve
</code></pre>
<h2 id="yay-command"><a class="header" href="#yay-command">yay command</a></h2>
<pre><code class="language-sh">#Example 1: Install package using yay
#Use the option `-S` to install a package from AUR using yay.
yay -S package
#Example 2: Remove package using yay
#To remove a package, use `-Rns` options:
yay -Rns package
#Example 3: Launch a package selection menu
yay &lt;Search Term&gt;
#Example 4: Upgrade installed packages using yay
#To upgrade all installed packages, use the options :
yay -Syu
#To include development packages, use:
yay -Syu --devel --timeupdate
#Example 5: Cleans unneeded dependencies using yay
#Use the options to remove all unneeded dependencies on your system:
yay -Yc
#remove all of these unnecessary packages with the following command:
sudo pacman -R $(pacman -Qdtq)
#Example 6: Prints system statistics using yay
#To print system stats, use `-Ps`
yay -Ps
#Example 7: Generates development package DB used for devel updates
yay -Y --gendb
#Clean the cache
yay -Scc
</code></pre>
<h2 id="git-useage"><a class="header" href="#git-useage">git useage</a></h2>
<pre><code class="language-sh">#install git-lfs
yay -S git-lfs
git init
git lfs track "*.ipynb" "*.zip" "*.7z"
#使用git clone命令来克隆LFS仓库例如
git clone https://github.com/user/repo.git
#进入刚刚克隆的仓库目录
cd repo
git lfs fetch
#通过上述命令Git LFS将下载所有在仓库中使用的LFS对象。
#通过git lfs checkout命令来检出LFS对象例如
#git lfs checkout
#Git LFS将把所有LFS对象从本地存储中检出到您的工作目录中。
git add .
git commit -m "python_code"
git remote add origin git@e.coding.net:googleteam/data_mining/python_code.git
git push -u origin master
#create repo commmand line
git push --set-upstream git@gitcode.net:dnrops/$(git rev-parse --show-toplevel | xargs basename).git $(git rev-parse --abbrev-ref HEAD)
#remove remote origin
git remote rm origin
#all in one line
git init &amp;&amp; git add . &amp;&amp; git commit -m "bookmark" &amp;&amp; git remote add origin git@e.coding.net:googleteam/my_code/book_mark.git &amp;&amp; git push -u origin master
#pull from repo
git pull origin main
#switch branch
git branch -M main
#push to repo
git push -uf origin main
#https://bitbucket.org/dashboard/repositories
FQXwgrR7AcVF6K2dMqe5
#https://code.educoder.net/
U:pef9toi32
P:m...
#github
yay -S github-cli
github token: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
gh auth login
git config --global user.email "dnrops@outlook.com"
git config --global user.name "dnrops"
</code></pre>
<h2 id="linux-find-dir-or-file"><a class="header" href="#linux-find-dir-or-file">linux find dir or file</a></h2>
<pre><code class="language-sh">find ./code -name .git -d
find ./code -name command_list.md -d
</code></pre>
<h2 id="file-statistics"><a class="header" href="#file-statistics">File statistics</a></h2>
<pre><code class="language-sh"># Displays the size of the current folder
du -sh
# Lists the size of each directory under the current folder
du -lh --max-depth=1
# Lists the space usage of the current file system
df -lh
</code></pre>
<h2 id="view-disk-useage"><a class="header" href="#view-disk-useage">View disk useage</a></h2>
<pre><code class="language-sh">yay -S baobab
baobab
</code></pre>
<h2 id="open-sunloginclient"><a class="header" href="#open-sunloginclient">Open sunloginclient</a></h2>
<pre><code class="language-sh">systemctl start runsunloginclient.service
sunloginclient
</code></pre>
<h2 id="conda-env"><a class="header" href="#conda-env">Conda env</a></h2>
<pre><code class="language-sh">yay -S miniconda
# conda
export PATH="/opt/miniconda/bin:$PATH"
conda config --set show_channel_urls yes
#add to ~/.condarc
```
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.zju.edu.cn/anaconda/pkgs/main
- https://mirrors.zju.edu.cn/anaconda/pkgs/r
- https://mirrors.zju.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.zju.edu.cn/anaconda/cloud
msys2: https://mirrors.zju.edu.cn/anaconda/cloud
bioconda: https://mirrors.zju.edu.cn/anaconda/cloud
menpo: https://mirrors.zju.edu.cn/anaconda/cloud
pytorch: https://mirrors.zju.edu.cn/anaconda/cloud
pytorch-lts: https://mirrors.zju.edu.cn/anaconda/cloud
simpleitk: https://mirrors.zju.edu.cn/anaconda/cloud
```
#conda activate:
source /opt/anaconda/bin/activate google
#create conda environment
conda create -n env_name python=3.7
#remove conda environment
conda remove -n your_env_name --all
#remove conda environments package
conda remove --name $your_env_name $package_name
#exit conda environment
#Linux
source deactivate your_env_name
#Windows
deactivate env_name
</code></pre>
<h2 id="nvim-initvim"><a class="header" href="#nvim-initvim">nvim init.vim</a></h2>
<pre><code class="language-sh">/home/andry/.config/nvim/init.vim
map td :tabnew .&lt;cr&gt;
map tp :tabprevious &lt;cr&gt;
map tn :tabnext&lt;cr&gt;
map jk :w!&lt;cr&gt;
map &lt;C-F&gt; :!cargo fmt&lt;cr&gt;
map &lt;C-R&gt; :!cargo fmt &amp;&amp; cargo run&lt;cr&gt;
</code></pre>
<h2 id="install-qq"><a class="header" href="#install-qq">install QQ</a></h2>
<pre><code class="language-sh">yay -S deepin-wine-qq
</code></pre>
<h2 id="install-wechat"><a class="header" href="#install-wechat">install wechat</a></h2>
<pre><code class="language-sh">#https://github.com/vufa/deepin-wine-wechat-arch/releases
yay -S deepin-wine6-stable
yay -S deepin-wine-helper
wget https://gitcode.net/dnrops/atom_bin/-/raw/master/wechat/deepin-wine-wechat-3.7.6.44-1-x86_64.pkg.tar.zst
yay -U deepin-wine-wechat-3.7.0.29-1-x86_64.pkg.tar.zst
duma https://ghproxy.com/https://github.com/vufa/deepin-wine-wechat-arch/releases/download/v3.7.6.44-1/deepin-wine-wechat-3.7.6.44-1-x86_64.pkg.tar.zst
</code></pre>
<h2 id="install-rust-cratesio-token"><a class="header" href="#install-rust-cratesio-token">install rust crates.io token</a></h2>
<pre><code class="language-sh">export RUSTUP_DIST_SERVER="https://rsproxy.cn"
export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"
yay -S rustup
yay -S rust-analyzer-nightly
rustup install nightly
https://crates.io/settings/tokens
</code></pre>
<h2 id="cargo-install-loop"><a class="header" href="#cargo-install-loop">cargo install loop</a></h2>
<pre><code class="language-sh">echo '\nexport PATH="~/.cargo/bin:$PATH"' &gt;&gt; ~/.bashrc
echo '\nexport PATH=\"~/.cargo/bin:\$PATH\"' &gt;&gt; ~/.bashrc
echo '\nexport RUSTUP_DIST_SERVER=\"https://mirrors.tuna.tsinghua.edu.cn/rustup\"' &gt;&gt; ~/.bashrc
echo '\nexport RUSTUP_UPDATE_ROOT=\"https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup\"' &gt;&gt; ~/.bashrc
curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh -s -- -y
source "$HOME/.cargo/env"
while true
do
cargo install hex_dump --force
cargo install base64_img_cli --force
cargo install base64_text --force
cargo install base64_text --force
cargo install xl_to_csv --force
cargo install serve-cli --force
cargo install ghc --force
cargo install npms --force
cargo install bili_search --force
cargo install mook --force
cargo install pdf_cli --force
cargo install look_ip --force
done
</code></pre>
<h2 id="yarn-and-npm"><a class="header" href="#yarn-and-npm">yarn and npm</a></h2>
<pre><code class="language-sh">yarn config get registry
npm config get registry
yarn config set registry http://registry.npmmirror.com
npm config set registry http://registry.npmmirror.com
//恢复官方源
yarn config set registry https://registry.yarnpkg.com
npm config set registry https://registry.npmjs.org
npm config set registry https://mirrors.sjtug.sjtu.edu.cn/npm-registry
yarn config set registry https://mirrors.sjtug.sjtu.edu.cn/npm-registry
#npm login 需要恢复官方源
U:dnrops
P:m...
email:dnrops@outlook.com
one-time-code from iphone:**
</code></pre>
<h2 id="angular"><a class="header" href="#angular">Angular</a></h2>
<pre><code class="language-sh">#While creating a new project
ng new angularguard
#Component
ng generate component components/footer --module=app.module //optional
ng generate component components/footer
ng g c articles/git/git_guide
#Service
ng generate service service/ui
#Test dist
serve dist/
#json-serve
#install
npm i json-server
#package.json add
"server": "json-server --watch db.json --port 7000"
#and run
yarn server
#use antidesign in angular
ng g ng-zorro-antd:notification-with-icon anticomponent/false --module=app.module
#Angular开发提示 Object is possibly 'null' 恼人的提示谁有那时间写出完美的代码呢有null是正常的。这提示该关闭。网上找到了关闭的方法
tsconfig.json &gt; compilerOptions, 增加:
"strictNullChecks":false
# angular pulish to github
#把生成的inde.html 复制成404.html ,把整个docs 文件夹里的资源上传就好了
ng build --output-path docs --base-href /alenandry.github.io/
# pulish GitHub Pages
git push -u origin main
</code></pre>
<h2 id="vscode-save-and-run-command"><a class="header" href="#vscode-save-and-run-command">Vscode save and run command</a></h2>
<p>1.install the <code>ext install wk-j.save-and-run</code>
2.add to settings.json</p>
<pre><code class="language-json">atom ~/.config/Code/User/settings.json
//saveAndRun
{
"saveAndRun": {
"commands": [
{
"match": "Demo.tex",
"cmd": "bash compile.sh",
"useShortcut": false,
"silent": false
}
]
}
}
</code></pre>
<h2 id="latex-commen-syntax"><a class="header" href="#latex-commen-syntax">latex commen syntax</a></h2>
<pre><code>一行对齐
\leftline{左对齐}
\centerline{居中}
\rightline{右对齐}
多行或者段落对齐
左对齐 \begin{flushleft}...\end{flushleft}
居中 \begin{center}...\end{center}
右对齐 \begin{flushright}...\end{flushright}
加粗 \textbf{步骤3}
</code></pre>
<h2 id="fast-delete-some-folder"><a class="header" href="#fast-delete-some-folder">fast delete some folder</a></h2>
<pre><code class="language-sh">#copy save to delete.sh bash delete.sh ./some_ir
mkdir empty &amp;&amp; rsync -r --delete empty/ $1 &amp;&amp; rmdir $1
rmdir empty
</code></pre>
<h2 id="record-screen-and-save-gif"><a class="header" href="#record-screen-and-save-gif">record screen and save .gif</a></h2>
<pre><code class="language-sh">yay -S peek
peek
</code></pre>
<h2 id="simple-screenshot-sotfware"><a class="header" href="#simple-screenshot-sotfware">simple screenshot sotfware</a></h2>
<pre><code class="language-sh">yay -S xfce4-scrennshoter
</code></pre>
<p><img src="../../img_list/7f37bcd09f7f49a8a4bc31b6b041f65atplvk3u1fbpfcpwatermark.png" alt="image-20220310093334431.png" />
s</p>
<h2 id="linux-add-font"><a class="header" href="#linux-add-font">linux add font</a></h2>
<pre><code class="language-sh">wget https://gitcode.net/dnrops/fonts/-/raw/master/autobus/Autobusbold-1ynL.ttf
#create dir
sudo mkdir /usr/share/fonts/Autobusbold
#mv font file to dir
mv ./Autobusbold-1ynL.ttf /usr/share/fonts/Autobusbold/simhei.ttc
#give font file permission, (only the owner have read and write access)
sudo chmod 644 /usr/share/fonts/Autobusbold/*
#update fonts
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fsv
</code></pre>
<h2 id="linux-dns"><a class="header" href="#linux-dns">linux dns</a></h2>
<pre><code class="language-sh">atom /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.77.75
</code></pre>
<h2 id="run-matlab-in-linux"><a class="header" href="#run-matlab-in-linux">run matlab in linux</a></h2>
<pre><code class="language-sh">ocsptool
octave-cli
octave-config
octave-statistics
</code></pre>
<h2 id="docker"><a class="header" href="#docker">docker</a></h2>
<pre><code class="language-sh">#Switch to the root user first, and then execute the following command
su root
ubuntu{
systemctl unmask docker.service
systemctl unmask docker.socket
systemctl start docker.service
}
archliux{
#automaticaly start in docker
systemctl enable docker
# start docker
systemctl start docker
# restart dokcer
systemctl restart docker
}
#/etc/docker/daemon.json 中写入
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
]
}
#reboot docker after set mirror
sudo systemctl daemon-reload
sudo systemctl restart docker
#start open in terminal
docker run -it zinso/rust_nightly
#start run in backgroud
docker run -d zinso/rust_nightly
#dock image change_mirrorlist
curl --proto '=https' --tlsv1.2 -sSf https://gitcode.net/dnrops/mirrorlist/-/raw/master/change_mirorlist.sh | sh
#get image iD and status
docker ps
#save changed image
#docker commit &lt;container_id&gt; &lt;image_name&gt;
docker commit 6247746ea21b archlinux
#viewe all images
docker images
#build from Dockerfile
docker build -t latest .
#docker remove all images and cache
docker system prune
#Check for running containers:
docker ps
#List all containers running on the host for deletion:
docker ps -a
#Stop a running container:
docker stop &lt;CONTAINER ID&gt;
#Killing still running containers:
docker kill &lt;CONTAINER ID&gt;
#Delete containers listed by ID:
docker rm &lt;CONTAINER ID&gt;
#List all Docker images:
docker images
#Delete images by ID:
docker rmi &lt;IMAGE ID&gt;
#Delete all images, containers, volumes, and networks that are not associated with a container (dangling):
docker system prune
#To additionally remove any stopped containers and all unused images (not just dangling ones), add the -a flag to the command:
docker system prune -a
#Delete all Docker data (purge directory):
rm -R /var/lib/docker
</code></pre>
<h2 id="deno-change-mirror"><a class="header" href="#deno-change-mirror">deno change mirror</a></h2>
<pre><code class="language-sh">##change
https://deno.land/std/
##to
https://gitcode.net/dnrops/deno_std/-/raw/main/
</code></pre>
<h2 id="my-bashrc"><a class="header" href="#my-bashrc">my ~/.bashrc</a></h2>
<pre><code class="language-sh"># ~/.bashrc
# If not running interactively, don't do anything
[[ $- != *i* ]] &amp;&amp; return
[[ -f ~/.welcome_screen ]] &amp;&amp; . ~/.welcome_screen
_set_liveuser_PS1() {
PS1='[\u@\h \W]\$ '
if [ "$(whoami)" = "liveuser" ] ; then
local iso_version="$(grep ^VERSION= /usr/lib/endeavouros-release 2&gt;/dev/null | cut -d '=' -f 2)"
if [ -n "$iso_version" ] ; then
local prefix="eos-"
local iso_info="$prefix$iso_version"
PS1="[\u@$iso_info \W]\$ "
fi
fi
}
_set_liveuser_PS1
unset -f _set_liveuser_PS1
ShowInstallerIsoInfo() {
local file=/usr/lib/endeavouros-release
if [ -r $file ] ; then
cat $file
else
echo "Sorry, installer ISO info is not available." &gt;&amp;2
fi
}
alias ls='ls --color=auto'
alias ll='ls -lav --ignore=..' # show long listing of all except ".."
alias l='ls -lav --ignore=.?*' # show long listing but no hidden dotfiles except "."
[[ "$(whoami)" = "root" ]] &amp;&amp; return
[[ -z "$FUNCNEST" ]] &amp;&amp; export FUNCNEST=100 # limits recursive functions, see 'man bash'
## Use the up and down arrow keys for finding a command in history
## (you can write some initial letters of the command first).
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
################################################################################
## Some generally useful functions.
## Consider uncommenting aliases below to start using these functions.
##
## October 2021: removed many obsolete functions. If you still need them, please look at
## https://github.com/EndeavourOS-archive/EndeavourOS-archiso/raw/master/airootfs/etc/skel/.bashrc
_open_files_for_editing() {
# Open any given document file(s) for editing (or just viewing).
# Note1:
# - Do not use for executable files!
# Note2:
# - Uses 'mime' bindings, so you may need to use
# e.g. a file manager to make proper file bindings.
if [ -x /usr/bin/exo-open ] ; then
echo "exo-open $@" &gt;&amp;2
setsid exo-open "$@" &gt;&amp; /dev/null
return
fi
if [ -x /usr/bin/xdg-open ] ; then
for file in "$@" ; do
echo "xdg-open $file" &gt;&amp;2
setsid xdg-open "$file" &gt;&amp; /dev/null
done
return
fi
echo "$FUNCNAME: package 'xdg-utils' or 'exo' is required." &gt;&amp;2
}
#------------------------------------------------------------
## Aliases for the functions above.
## Uncomment an alias if you want to use it.
##
# alias ef='_open_files_for_editing' # 'ef' opens given file(s) for editing
# alias pacdiff=eos-pacdiff
################################################################################
alias yay_cache="thunar ~/.cache/yay/"
alias paru_cache="thunar ~/.cache/paru/"
alias open_mirror="atom /etc/pacman.d/mirrorlist"
alias open_markdown="thunar /run/media/andrew/DATA/code/rust_code/rust_fontend/dioxus_blog/src/markdown_files/"
alias clear_cargo_cache="rm -rf ~/.cargo/.package-cache"
alias clear_pacman="sudo rm -rf /var/lib/pacman/sync/*"
alias fast_download="duma -U Chrome/51.0.2704.103 -c -n 1000 -T 5000"
alias tt="sogou_translate_cli -m "
alias open_command="typora ~/code/gitcode/my_command_list/README.md"
#git path
export PATH="/usr/bin/git:$PATH"
#deno path
export PATH="/home/andrew/.deno/deno_bin:$PATH"
#rustup
export RUSTUP_UPDATE_ROOT="https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup"
export RUSTUP_DIST_SERVER="https://mirrors.tuna.tsinghua.edu.cn/rustup"
#rust
export PATH="/home/andrew/.cargo/bin:$PATH"
#hx path
export PATH="/home/andrew/.config/helix:$PATH"
#ruby path
export PATH="/home/andrew/.local/share/gem/ruby/3.0.0/bin:$PATH"
#starship
eval "$(starship init bash)"
#webpack error
export NODE_OPTIONS=--openssl-legacy-provider
# Load Angular CLI autocompletion.
source &lt;(ng completion script)
</code></pre>
<h2 id="nushell"><a class="header" href="#nushell">nushell</a></h2>
<pre><code class="language-sh">#How to list your environment variables
$env
#add to env
let-env PATH = ($env.PATH | append "some/other/path")
</code></pre>
<h2 id="fast-github"><a class="header" href="#fast-github">fast github</a></h2>
<pre><code class="language-sh">https://hub.fastgit.xyz/
https://hub.xn--p8jhe.tw/
https://hub.xn--gzu630h.xn--kpry57d/
https://hub.nuaa.cf/
</code></pre>
<h2 id="install-and-configure-starship--nushell"><a class="header" href="#install-and-configure-starship--nushell">install and configure starship &amp;&amp; nushell</a></h2>
<pre><code class="language-sh">#starship
cargo install starship --locked
#add to ~/.bashhrc
eval "$(starship init bash)"
#open starship.toml and add
atom ~/.config/starship.toml
##add to starship.toml
"$schema" = 'https://gitlab.com/andrew_ryan/rust_code/-/raw/master/rust_codewar/config-schema.json'
scan_timeout = 1000
command_timeout = 100000
##
#nushell
$nu.config-path #get config path
atom /home/andrew/.config/nushell/config.nu
/home/andrew/.config/nushell/env.nu
/home/andrew/.config/nushell/config.nu
#run the command add add to config.nu
starship init nu | save ~/.cache/starship/init.nu
##add to ~/.cache/starship/init.nu
source ~/.cache/starship/init.nu
alias yay_cache = (thunar "~/.cache/yay/")
alias pacman_mirror = (atom "/etc/pacman.d/mirrorlist")
alias open_mirror = (atom "/etc/pacman.d/mirrorlist")
alias open_cargo_config = (atom "~/.cargo/config")
alias clear_cargo_cache = (rm -rf "~/.cargo/.package-cache")
alias fast_download = duma -U Chrome/51.0.2704.103 -c -n 1000 -T 5000
alias tt = sogou_translate_cli -m
##
</code></pre>
<h2 id="install-endeaver-linux"><a class="header" href="#install-endeaver-linux">install endeaver linux</a></h2>
<pre><code class="language-sh">#1.open gparted partition free disk
#2.open installer
#3.add each partition flag
#4.after instalation done reboot
#5.change mirror
#6.install sougoupinyin
#7.install screenshot: flameshot -gui =&gt;&gt;start
#8.install microsoft-ede-browser
#9.install rust
#10.install miniconda and add mirror
#11.yay -S xfce4-clipman-plugin to install clipboard maneger
#12.install eye protection: yay -S safeeyes || yay -S redshift
#13.open eye protection redshift -P -O 3000
yay -S fcitx fcitx-qt6 fcitx-qt5 fcitx-configtool fcitx-im clang lld xfce4-clipman-plugin fcitx-sogoupinyin deno cmake redshift obs-studio deepin-wine-wechat mpv flameshot git-lfs upx linux-wifi-hotspot paru wasm-bindgen dart-sass wasmer
yay -S whitesur-icon-theme feishu-bin google-chrome microsoft-edge-stable-bin
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
git config --global user.email "dnrops@aliyun.com"
git config --global user.name "dnrops"
</code></pre>
<h2 id="dexios-encriypt"><a class="header" href="#dexios-encriypt">dexios encriypt</a></h2>
<pre><code class="language-sh">#install
cargo install dexios
#encrypt folder to .7z compress level=9 递归加密
dexios pack -r --level=9 -ea2 ./demo/ ./demo.7z
#decrypt encrypted .7z to folder
dexios pack -r --level=9 -d ./demo.7z ./demo
#To just encrypt a file:
dexios -e test.txt test.enc
#To just decrypt a file:
dexios -d test.enc test.txt
#To just erase a file:(delete file)
dexios erase test.txt
#To list all possible AEADs:
dexios list aead
#To pack and encrypt a folder:
dexios pack encrypt test/ file.encrypted
#To decrypt and unpack a folder:
dexios pack decrypt file.encrypted test/
#To encrypt a file using (note: you do not need to specify when decrypting):AES-256-GCM-a
dexios -ea2 test.txt test.enc
#To encrypt a file, and show the hash of the encrypted (output) file for verification later on:
dexios -eH test.txt test.enc
#To decrypt a file, and show the hash of the encrypted file (to compare with the hash generated above):
dexios -dH test.enc test.txt
#To encrypt a file, and erase the original file:
dexios -e --erase test.txt test.enc
#To use a keyfile for encryption:
dexios -ek keyfile test.txt test.enc
</code></pre>
<h2 id="iso-crate-usb-system-booter"><a class="header" href="#iso-crate-usb-system-booter">iso crate usb system booter</a></h2>
<pre><code class="language-sh">yay -S etcher-bin
</code></pre>
<h2 id="genarate-gpg-key"><a class="header" href="#genarate-gpg-key">genarate GPG key</a></h2>
<pre><code class="language-sh">gpg --full-generate-key # choose (1) RSA and RSA (default)
gpg --list-secret-keys --keyid-format=long #list valid keys and show id
gpg --armor --export dnrops #show publick key ,dnrops is id
#delete by [key_id]
gpg --delete-secret-key 78FDEF1E42F50BF16542D4AB5B15C5DE1E4847BF
</code></pre>
<h2 id="genate-ssh-key"><a class="header" href="#genate-ssh-key">genate SSH key</a></h2>
<pre><code class="language-sh">#linux
ssh-keygen -t ed25519 -C "dnrops_anonymous@tutanota.com" #generate ssh key
cat /home/andrew/.ssh/id_ed25519.pub #show ssh key
#windows
ssh-keygen.exe
cat C:\Users\Administrator/.ssh/id_rsa.pub
</code></pre>
<h2 id="use-helix"><a class="header" href="#use-helix">Use helix</a></h2>
<pre><code class="language-sh">space+y =&gt;yank to system clipboard
space+w+l =&gt;change vs to left
space+w+h =&gt;change vs to right
space+/ =&gt;global search
space+k =&gt;Show docs for item under cursor
space+r =&gt;Rename symbol under cursor letter
e =&gt; next word
b =&gt; previos word
c =&gt; retype current word
r =&gt; replease current letter
g+d =&gt;Goto code definition
g+n =&gt;Goto next buffer
g+p =&gt;Goto previous buffer(back to current code)
## for Rust
yay -S rust-analyzer
yay -S lldb
</code></pre>
<h2 id="re-generate-grub-config"><a class="header" href="#re-generate-grub-config">re-generate GRUB config</a></h2>
<pre><code class="language-sh">#每次安装或者移除一个内核后,你都需要重新运行一次 grub-mkconfig 命令
sudo grub-mkconfig -o /boot/grub/grub.cfg
</code></pre>
<h2 id="rust-add-wasm32"><a class="header" href="#rust-add-wasm32">rust add wasm32</a></h2>
<pre><code class="language-sh"># download lib.7z and copy to /home/andrew/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/ folder
# /home/andrew/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib
# or run the command
rustup target add wasm32-unknown-unknownwn
</code></pre>
<h2 id="cargo-config"><a class="header" href="#cargo-config">cargo config</a></h2>
<pre><code class="language-sh">[source.crates-io]
replace-with = "rsproxy"
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"
[source.bfsu]
registry = "https://mirrors.bfsu.edu.cn/git/crates.io-index.git"
[source.hit]
registry = "https://mirrors.hit.edu.cn/crates.io-index.git"
[source.nju]
registry = "https://mirror.nju.edu.cn/git/crates.io-index.git"
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
[net]
retry = 3 # network retries
git-fetch-with-cli = true # use the `git` executable for git operations
[alias] # command aliases
b = "build"
c = "check"
t = "test"
r = "run"
rr = "run --release"
br = "build --release"
[build]
jobs = 8 # number of parallel jobs, defaults to # of CPUs
rustc = "rustc" # the rust compiler tool
rustdoc = "rustdoc" # the doc generator tool
target-dir ="rust_target"
rustdocflags = ["--default-theme", "coal"]
[doc]
browser = "chromium"
[profile.dev]
opt-level = 0
debug = 2
incremental = true
[profile.release]
codegen-units = 1
strip = true
panic = "abort"
lto = true
incremental = false
opt-level = "s"
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]
[llvm]
link-shared= true
</code></pre>
<h2 id="linux-set-dns"><a class="header" href="#linux-set-dns">linux set dns</a></h2>
<pre><code class="language-sh"># atom /etc/resolv.conf
# Generated by NetworkManager
search bbrouter
#nameserver 192.168.1.1
nameserver 119.29.29.29 #tencen dns
</code></pre>
<h2 id="npmjscom-recover-code"><a class="header" href="#npmjscom-recover-code">npmjs.com recover code</a></h2>
<pre><code class="language-sh">#Two-Factor Authentication
#open iphone setting paswords and find npmjs.com open to see Verification Code
307d732f2744233108e5e13c8b9ee3d77ae466c332a270f78d42800f69fd316d
90e9b65e5ffe2d2cb48654e849a91bd91837fea0ef004b7f92694e842688abe2
43f974262bc32574be7d5d3edb54d7a17c48ee609191a19ba329b8dd4544bb54
de46374d822cc274364fb497d8fc5a8c4dd46f3d4caeeaf7c42a4c9dcba92feb
12c0f55f1dc3902248fba5af4c51dd65a1c701a480f3666ba138bc68a148e500
</code></pre>
<h2 id="start-local-serve"><a class="header" href="#start-local-serve">start local serve</a></h2>
<pre><code class="language-sh">#install
npm install -g local-web-server
#start
ws --qr
</code></pre>
<h2 id="hosts"><a class="header" href="#hosts">hosts</a></h2>
<pre><code class="language-sh">#/etc/hosts
# Standard host addresses
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 andrew-lap
140.82.113.3 alive.github.com
140.82.113.3 live.github.com
140.82.113.3 central.github.com
3.235.146.215 desktop.githubusercontent.com
140.82.113.3 assets-cdn.github.com
3.236.219.148 camo.githubusercontent.com
151.101.1.6 github.map.fastly.net
151.101.1.6 github.global.ssl.fastly.net
140.82.113.3 gist.github.com
185.199.108.153 github.io
140.82.113.3 github.com
192.0.66.2 github.blog
140.82.113.3 api.github.com
3.238.199.124 raw.githubusercontent.com
18.206.187.210 user-images.githubusercontent.com
44.211.98.74 favicons.githubusercontent.com
18.232.31.239 avatars5.githubusercontent.com
44.197.117.33 avatars4.githubusercontent.com
35.168.112.147 avatars3.githubusercontent.com
3.233.233.24 avatars2.githubusercontent.com
44.197.117.33 avatars1.githubusercontent.com
3.214.224.150 avatars0.githubusercontent.com
3.238.254.30 avatars.githubusercontent.com
140.82.113.3 codeload.github.com
72.21.206.80 github-cloud.s3.amazonaws.com
72.21.206.80 github-com.s3.amazonaws.com
72.21.206.80 github-production-release-asset-2e65be.s3.amazonaws.com
72.21.206.80 github-production-user-asset-6210df.s3.amazonaws.com
72.21.206.80 github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153 githubstatus.com
140.82.113.18 github.community
52.224.38.193 github.dev
140.82.113.3 collector.github.com
3.238.254.30 pipelines.actions.githubusercontent.com
34.204.193.153 media.githubusercontent.com
100.26.176.110 cloud.githubusercontent.com
44.200.25.133 objects.githubusercontent.com
13.107.219.40 vscode.dev
13.225.103.88 static.rust-lang.org
104.192.141.1 bitbucket.org
34.120.231.152 gitpod.io
148.153.56.162 bilicdn1.com
23.236.97.62 bilibili.com
142.250.190.3 google.cn
172.65.253.13 deepl.com
78.31.64.14 mail.ipaddress.com
18.232.245.187 g.ezoic.net
18.67.76.44 mxtoolbox.com
119.3.229.170 gitcode.net
34.120.54.55 deno.land
172.253.115.100 cloud.google.com
3.234.104.255 ipaddress.com
172.66.43.71 codewars.com
54.192.150.28 docs.rs
172.66.40.185 www.codewars.com
192.227.67.57 handwiki.org
95.216.144.15 aur.archlinux.org
13.107.21.200 cn.bing.com
64.71.144.205 users.rust-lang.org
101.6.15.130 mirrors.tuna.tsinghua.edu.cn
173.236.212.42 typora.io
140.82.113.4 central.github.com
140.82.113.4 assets-cdn.github.com
151.101.1.6 github.map.fastly.net
151.101.1.6 github.global.ssl.fastly.net
140.82.113.4 gist.github.com
185.199.108.153 github.io
140.82.113.4 github.com
140.82.113.4 api.github.com
140.82.113.4 codeload.github.com
72.21.206.80 github-cloud.s3.amazonaws.com
72.21.206.80 github-com.s3.amazonaws.com
185.199.108.153 githubstatus.com
140.82.113.18 github.community
140.82.113.4 raw.github.com
104.18.2.36 sourcegraph.com
199.59.149.235 hellogithub.com
104.16.19.35 registry.npmjs.org
172.65.251.78 gitlab.com
</code></pre>
<h2 id="beave-browser-sync-code"><a class="header" href="#beave-browser-sync-code">beave browser sync code</a></h2>
<pre><code>wedding course business define ramp they dad forward artwork space oil flame civil knock aware purpose canvas warm flush physical spot pull swap such bag
</code></pre>
<h2 id="ui-design"><a class="header" href="#ui-design">UI design</a></h2>
<pre><code>Glassmorphism(毛玻璃效果) and Neumorphism(新拟物)
</code></pre>
<h2 id="grub2-add-win11-menuentry"><a class="header" href="#grub2-add-win11-menuentry">grub2 add win11 menuentry</a></h2>
<pre><code>#path
#sudo nano /boot/grub/grub.cfg
menuentry 'EndeavourOS Linux, with Linux linux' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-aa2a25bd-0ca9-488d-8249-eea80256b692' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root aa2a25bd-0ca9-488d-8249-eea80256b692
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=aa2a25bd-0ca9-488d-8249-eea80256b692 rw loglevel=3 nowatchdog nvme_load=YES nvidia-drm.modeset=1
echo 'Loading initial ramdisk ...'
initrd /boot/intel-ucode.img /boot/initramfs-linux.img
}
menuentry 'EndeavourOS Linux, with Linux linux (fallback initramfs)' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-aa2a25bd-0ca9-488d-8249-eea80256b&gt;
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root aa2a25bd-0ca9-488d-8249-eea80256b692
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=aa2a25bd-0ca9-488d-8249-eea80256b692 rw loglevel=3 nowatchdog nvme_load=YES nvidia-drm.modeset=1
echo 'Loading initial ramdisk ...'
initrd /boot/intel-ucode.img /boot/initramfs-linux-fallback.img
}
##添加 01E7-0316 是EFI分区的UUID gpated info 可以查到
menuentry 'Microsoft Windows 11' {
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --no-floppy --fs-uuid --set=root 01E7-0316
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
</code></pre>
<h2 id="rust-static-build"><a class="header" href="#rust-static-build">Rust static build</a></h2>
<pre><code class="language-sh">#add to .bashrc
#rustup
export RUSTUP_UPDATE_ROOT="https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup"
export RUSTUP_DIST_SERVER="https://mirrors.tuna.tsinghua.edu.cn/rustup"
#install
yay -S zig
yay -S llvm
yay -S openssl
yay -S rust-std-nightly-x86_64-unknown-linux-musl
rustup component add rustfmt-preview
rustup component add rls-preview
rustup component add clippy-preview
ustup component add llvm-tools-preview
rustup target add x86_64-unknown-linux-musl --toolchain=nightly
rustup default nightly-x86_64-unknown-linux-musl
cargo install cargo-zigbuild
cargo build --target x86_64-unknown-linux-musl
#or
./build
#second solution is better
docker pull ekidd/rust-musl-builder:latest
docker run --rm -it -v "$(pwd)" ekidd/rust-musl-builder
alias rust-musl-builder='docker run --rm -it -v &lt;Cargo.toml path&gt; ekidd/rust-musl-builder'
alias rust-musl-builder='docker run --rm -it -v /workspace/gap/lookup ekidd/rust-musl-builder'
rust-musl-builder cargo build --release
</code></pre>
<p>build.sh</p>
<pre><code class="language-sh">#!/usr/bin/env bash
set -e
USER=andrew
HOME=/home/andrew
PATH="$HOME/.cargo/bin:$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export OPENSSL_DIR=/usr
# sudo chown -R $USER:$USER target/
sudo chown -R $USER:$USER $HOME/.cargo/registry
# all three environment variables must be present to coerce it to static link
exec bash -lc '
OPENSSL_DIR=/usr\
cargo zigbuild --target=x86_64-unknown-linux-musl --release;
'
</code></pre>
<p>Rust reqwest static link error because of require openssl so use ureq insted</p>
<pre><pre class="playground"><code class="language-rust">fn main() {
run().unwrap();
}
#[allow(warnings)]
fn run() -&gt; Result&lt;(), Box&lt;dyn std::error::Error&gt;&gt; {
use std::time::Duration;
use ureq::{Agent, AgentBuilder};
let agent: Agent = ureq::AgentBuilder::new()
.timeout_read(Duration::from_secs(5))
.timeout_write(Duration::from_secs(5))
.build();
let body: String = agent
.get("http://open.iciba.com/dsapi/?date=2022-05-03")
.call()?
.into_string()?;
println!("{}", body);
Ok(())
}</code></pre></pre>
<h2 id="mac-commands"><a class="header" href="#mac-commands">mac commands</a></h2>
<pre><code class="language-bash">#show info
brew info firefox
#install
brew install firefox
#clean brew
brew cleanup --prune=all
#clean brew
</code></pre>
<h2 id="use-pyenv"><a class="header" href="#use-pyenv">use pyenv</a></h2>
<pre><code class="language-bash">#add to bash_profile
echo 'export PYENV_ROOT="$HOME/.pyenv"' &gt;&gt; ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' &gt;&gt; ~/.bash_profile
echo -e 'if command -v pyenv 1&gt;/dev/null 2&gt;&amp;1; then\n eval "$(pyenv init -)"\nfi' &gt;&gt; ~/.bash_profile
</code></pre>
<pre><code class="language-bash">pyenv install -l #list all python
pyenv install pypy2.7-7.3.8 #install py27
pyenv versions
pyenv shell system
pyenv shell pypy2.7
</code></pre>
<h2 id="publish-aur-package"><a class="header" href="#publish-aur-package">publish aur package</a></h2>
<p><img src="../../img_list/image20230829233959130.png" alt="image-20230829233959130" /></p>
<pre><code class="language-sh">ssh-keygen -f ~/.ssh/aur
#add ssh key to aur account
cat ~/.ssh/aur.pub
cargo install aur_cli
yay -S aur_cli
makepkg --printsrcinfo &gt; .SRCINFO
git clone git+ssh://aur@aur.archlinux.org/{pkg_name}
updpkgsums
ppush new
#other solution is install rust-aur
cargo install --git https://gitcode.net/dnrops/rust-aur-git.git
yay -S rust-aur-git
arg1 is rust project addres arg2 is cli name
rust-aur https://gitcode.net/dnrops/terminal-gpt-git.git terminal-gpt
</code></pre>
<h2 id="install-swift-in-archlinux"><a class="header" href="#install-swift-in-archlinux">install swift in archlinux</a></h2>
<pre><code class="language-sh">wget https://gitcode.net/dnrops/swift-bin/-/raw/10482cfc4feaeca4dbcccfda68d2c330e1d618cf/swift-bin-5.6-1-x86_64.pkg.tar.zst
yay -U swift-bin-5.6-1-x86_64.pkg.tar.zst
sudo ln -s /usr/lib64/libpython3.11.so.1.0 /usr/lib64/libpython3.6m.so.1.0
</code></pre>
<h2 id="start-postgresql"><a class="header" href="#start-postgresql">start postgresql</a></h2>
<pre><code>To start postgresql@14 now and restart at login:
brew services start postgresql@14
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14
</code></pre>
<h2 id="java-set-mvn-and-set-mutilple-jdk"><a class="header" href="#java-set-mvn-and-set-mutilple-jdk">java set mvn and set mutilple jdk</a></h2>
<pre><code class="language-sh">#install jdk8
yay -S jdk8-openjdk
#install jdk20
yay -S archlinuxcn/jdk
#get jdk list
archlinux-java status
#set jdk
sudo archlinux-java set java-8-openjdk
sudo archlinux-java set java-20-jdk
</code></pre>
<h2 id="start-ssh-server-and-connect"><a class="header" href="#start-ssh-server-and-connect">start ssh server and connect</a></h2>
<pre><code class="language-sh">#start ssh server
sudo systemctl start sshd
# connect ssh server
ssh andrew@172.20.10.2
OR
ssh andrew@$(ifconfig wlan0 | grep 'inet ' | awk '{print $2}')
</code></pre>
<h2 id="install-tools-for-bluetooth-earphone"><a class="header" href="#install-tools-for-bluetooth-earphone">install tools for bluetooth earphone</a></h2>
<pre><code class="language-sh">yay -S bluez bluez-utils bluez-firmware pulseaudio-bluetooth pavucontrol pulseaudio-alsa
</code></pre>
<h3 id="start-bluetooth-server"><a class="header" href="#start-bluetooth-server">start bluetooth server</a></h3>
<pre><code class="language-sh">systemctl enable bluetooth
systemctl start bluetooth
</code></pre>
<h3 id="start-pulseaudio"><a class="header" href="#start-pulseaudio">start pulseaudio</a></h3>
<pre><code class="language-sh">pulseaudio -k # 确保没有pulseaudio启动
pulseaudio --start # 启动pulseaudio服务
</code></pre>
<h3 id="start-firewall"><a class="header" href="#start-firewall">start firewall</a></h3>
<pre><code class="language-sh"># 添加白名单地址
firewall-cmd --permanent --add-source=192.168.1.100
# 将允许的IP或者IP段加入trusted白名单
firewall-cmd --permanent --add-source=192.168.1.15 --zone=trusted
# 放行IP允许指定IP所有端口都可以访问
firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address="1.1.1.1" accept"
# 对外暴露8787端口即任意ip都能访问
firewall-cmd --permanent --add-port=8787/tcp --zone=public
</code></pre>
<h3 id="manually-mount-disk"><a class="header" href="#manually-mount-disk">manually mount disk</a></h3>
<pre><code class="language-sh"># get disk list and device name
sudo fdisk -l
# mount /dev/sdb1 to /home/andrew/SDB/
sudo mount /dev/sdb1 /home/andrew/SDB/ -t auto
</code></pre>
<h2 id="powershell-set-executionpolicy"><a class="header" href="#powershell-set-executionpolicy">powershell set ExecutionPolicy</a></h2>
<pre><code class="language-powershell">Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope UserPolicy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope MachinePolicy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Get-ExecutionPolicy -List
</code></pre>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<a rel="prev" href="../../posts/linux/bash_profile.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../../posts/linux/git_guide.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
<div style="clear: both"></div>
</nav>
</div>
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
<a rel="prev" href="../../posts/linux/bash_profile.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../../posts/linux/git_guide.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
</div>
<script>
window.playground_line_numbers = true;
</script>
<script>
window.playground_copyable = true;
</script>
<script src="../../ace.js"></script>
<script src="../../editor.js"></script>
<script src="../../mode-rust.js"></script>
<script src="../../theme-dawn.js"></script>
<script src="../../theme-tomorrow_night.js"></script>
<script src="../../elasticlunr.min.js"></script>
<script src="../../mark.min.js"></script>
<script src="../../searcher.js"></script>
<script src="../../clipboard.min.js"></script>
<script src="../../highlight.js"></script>
<script src="../../book.js"></script>
<!-- Custom JS scripts -->
<script src="../../src/js/custom.js"></script>
</div>
</body>
</html>