- list users
compgen -uorcut -d ":" -f 1 /etc/passwd - list groups
>
compgen -g
This file contains hidden or 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
| use std::fs; | |
| use std::io::{ Read, Write }; | |
| use std::net::{ TcpListener, TcpStream}; | |
| fn main() { | |
| let server: TcpListener = TcpListener::bind("127.0.0.1:8080").unwrap(); | |
| for stream in server.incoming() { | |
| match stream { | |
| Ok(mut stream) => { | |
| router(stream) |
This file contains hidden or 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
| use std::fmt; | |
| // #[derive(Debug)] | |
| struct Point<T> { | |
| x: T, | |
| y: T, | |
| } | |
| impl <T> fmt::Debug for Point<T> where T: fmt::Display { | |
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
This file contains hidden or 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
| extern crate rand; | |
| use rand::prelude::*; | |
| fn main() { | |
| const LEN: usize = 10; | |
| let mut arr: [i32; LEN] = [0; LEN]; | |
| let mut rng = thread_rng(); | |
| for index in 0..LEN { | |
| arr[index] = rng.gen_range(0, 101) |
This file contains hidden or 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
| @echo off | |
| SET CMDER_ROOT=C:\PortableApps\cmder_mini | |
| SET ConEmuDir=C:\PortableApps\cmder_mini\vendor\conemu-maximus5 | |
| SET CMDER_INIT_BAT=C:\PortableApps\cmder_mini\vendor\init.bat | |
| C:\Windows\sysnative\cmd.exe /k "%CMDER_INIT_BAT%" |
-
sudo apt updatesudo apt upgrade
If you do encounter problem like this, "A new version of configuration file/etc/default/grub is available,but the version installed currently has been locally modified".
> You can choose "install the package maintainer's version."
NewerOlder