Skip to content

SysTutorials

  • Tutorials
  • Linux
  • Linux Manuals
  • Systems
  • Programming
  • Software
  • Subscribe
  • Search
SysTutorials

  • QA

    In Golang, how to convert a string to unicode rune array and back?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    In Golang, how to convert a string to unicode rune array and do the reverse way? Convert string s to a rune array: runes := []rune(s) Convert a rune array runes to string: str := string(runes)

    Read More In Golang, how to convert a string to unicode rune array and back?Continue

  • QA

    How to process a file line by line in Go?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    In the Go programming language, How to process a file line by line? An equivalent piece of Bash code could be while read line ; do echo $line done < ./input.txt You can make use of the bufio package’s Scan(). // open the file filepath f := os.Open(filepath) // create a scanner fs := bufio.NewScanner(f)…

    Read More How to process a file line by line in Go?Continue

  • QA

    In Node.js, how to import functions from another JavaScript file?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    In Node.js, how to import functions from another JavaScript file like source common.sh in Bash? In the .js file to be imported such as ‘common.js’, organize functions to be exported like module.exports = { func1: function () { // func1 impl }, func2: function () { // func2 impl } }; In the other .js…

    Read More In Node.js, how to import functions from another JavaScript file?Continue

  • QA

    How to convert the dmesg timestamps to easier to read format on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    The dmesg results from newer Linux kernels show the timestamps. It seems the time in seconds since the kernel start time. How to convert the dmesg timestamps to the real time on Linux? The dmesg timestamp is the time in seconds since the kernel starting time. Later dmesg has an -T option: -T, –ctime Print…

    Read More How to convert the dmesg timestamps to easier to read format on Linux?Continue

  • QA

    How to get the full path and directory of a Makefile itself?

    ByEric Ma Mar 24, 2018Jun 9, 2018

    How to get the full path and directory of a Makefile itself like finding Bash script’s own path? This 2 lines in Makefile get the full path and dir of the Makefile itself: mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) mkfile_dir := $(dir $(mkfile_path)) The piece of code gets you Makefile, finds its absolute path and the…

    Read More How to get the full path and directory of a Makefile itself?Continue

  • QA

    How to grep a tab on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How to grep a tab on Linux? Including ‘t’ seems not working. grep can grep tabs. The problem is likely the tab is not passed to grep. If you are using Bash, you can use ANSI-C quoting to pass the “tab” to grep: $ grep $’t’ file.txt Or, use Perl-style regex (only for GNU grep)…

    Read More How to grep a tab on Linux?Continue

  • QA

    How to create a Reader from a string in Go?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    In Go, how to create a Reader from a string? Many APIs use a Reader as its input. In Go, the strings.NewReader(s) library function creates a Reader from a string. Check the doc at: https://golang.org/pkg/strings/#NewReader

    Read More How to create a Reader from a string in Go?Continue

  • QA

    Where are the data of metro apps stored in Windows 10?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    Where are the files for data of the moden metro apps stored in Windows 10? The files for data of the metro apps in Windows is stored under %userprofile%AppDataLocalPackages You can enter the string in the Explore and hit enter to open the directory directly.

    Read More Where are the data of metro apps stored in Windows 10?Continue

  • QA

    Where are the Start menu files in Windows 10?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    Where are the Start menu files actually stored in Windows 10? There are two folders for the startup menu for Windows: Per-user Start menu: %userprofile%AppDataRoamingMicrosoftWindowsStart Menu All user’s Start menu: %programdata%MicrosoftWindowsStart Menu

    Read More Where are the Start menu files in Windows 10?Continue

  • QA

    Which ssh client on iOS works the best for socks?

    ByEric Ma Mar 24, 2018Mar 11, 2019

    There are good ssh clients on Windows and, needless to mention, Linux. But which ssh client on iOS for iPhone/iPad works the best for socks? You may try vSSH. It is the best SSH client app I found on iOS. vSSH supports tunneling/port forwarding: you can setup port tunneling in the “Port forwarding” section of…

    Read More Which ssh client on iOS works the best for socks?Continue

  • QA

    How to choose the key used by SSH for a specific host?

    ByEric Ma Mar 24, 2018Nov 15, 2018

    How to choose a key used rather than the default ~/.ssh/id_rsa when ssh to a remote server for a specific host? You have at least 2 choices for choosing the key used by ssh. Taking ~/.ssh/key1 and user@example.com as the example here. Method one, specify the key in command line with the -i option of…

    Read More How to choose the key used by SSH for a specific host?Continue

  • QA

    how to use pc internet of window8 on iphone 4s via usb

    ByEric Ma Mar 24, 2018Mar 24, 2018

    how to use pc internet on iPhone 4s wia usb cable, pc is of window 8 and in network setting its not showing of connection of I phones network I ever wrote a tutorial at http://www.systutorials.com/136003/iphone-connecting-internet-using-windows-pc-network-through-usb-cable/ . But please be aware that it worked only on specific OS combinations. So, I am not sure whether…

    Read More how to use pc internet of window8 on iphone 4s via usbContinue

  • QA

    How to get the metadata of an AWS S3 object?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    I upload files using the aws cli http://www.systutorials.com/239665/uploading-large-files-amazon-s3-aws-cli/ . But how to get the metadata of an object in AWS S3? You can use the s3api‘s head-object command to get the metadata of an object. Taking one example: $ aws s3api head-object –bucket test-hkust –key dir2/fileupload/fb0c6353-a90c-4522-9355-7cd16cf756ff.file.txt It will print results like { “AcceptRanges”: “bytes”, “ContentType”:…

    Read More How to get the metadata of an AWS S3 object?Continue

  • QA

    How to disable an option with a bash script?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    It is possible to set an option inside a Bash script such as set -o errexit. But how to do the reverse thing, that is, to unset an option? Change – to + to do the reverse thing of unseting an option in bash. For example, to unset the errexit option set by set -o…

    Read More How to disable an option with a bash script?Continue

  • QA

    How to check whether a function has been defined in Bash?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    I would like to know whether a function, say f1(), has already been defined in Bash. How should I do it? You can use the type -t to get a string of the type of the name: If the -t option is used, type prints a string which is one of alias, keyword, function, builtin,…

    Read More How to check whether a function has been defined in Bash?Continue

  • QA

    How to change a user’s username on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    I want to rename a user’s username on Linux. For example, rename user u1 to user1. How to change a user’s username on Linux? You can use the usermod command to modify the user’s info. For changing the user name, you can use the -l option: -l, –login NEW_LOGIN The name of the user will…

    Read More How to change a user’s username on Linux?Continue

  • QA

    how change my policy of scheduling in hadoop?

    ByEric Ma Mar 24, 2018Oct 7, 2019

    I want to change policy of scheduling in Hadoop, how to I can change job order in map reduce automatically. Assume you are using Hadoop 2 / YARN. The configuration parameter named yarn.resourcemanager.scheduler.class controls the class to be used as the resource scheduler for YARN/Hadoop. The default value for the scheduler class (check more at…

    Read More how change my policy of scheduling in hadoop?Continue

  • QA

    How to get the CPU temperatur in command linux on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    Most modern servers or computers have sensors to detect the temperature of various components. On Linux, how to get the CPU core temperatur in command linux? First, make sure the package “lm-sensors” is installed on your Linux and the command sensors works for you. Then, you can use this piece of script to get the…

    Read More How to get the CPU temperatur in command linux on Linux?Continue

  • QA

    How to make lftp to use key for authentication for sftp on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    I have successfully enabled password-less ssh login to a remote server, say example.com with username user. But when I use lftp to log on the sftp by lftp sftp://user@example.com it still asks my password. How it make lftp use my private key to logon the remote lftp server? There is a little trick to make…

    Read More How to make lftp to use key for authentication for sftp on Linux?Continue

  • QA

    How to make the rpcbind.service auto start in systemd on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    The command systemctl enable rpcbind.service seems not work. The rpcbind.service does not start after rebooting. How to make/force the rpcbind.service auto start in systemd on Linux? You an force the rpcbind.service to start by making it be “wanted” by the target such as multi-user: # systemctl add-wants multi-user rpcbind.service This will force rpcbind.service to start.

    Read More How to make the rpcbind.service auto start in systemd on Linux?Continue

Page navigation

Previous PagePrevious 1 … 18 19 20 21 22 … 70 Next PageNext

© 2026 SysTutorials

  • Tutorials
  • Linux
  • Linux Manuals
  • Systems
  • Programming
  • Software
  • Subscribe
  • Search