by Devin Yang
(This article was automatically translated.)

Published - 7 years ago ( Updated - 7 years ago )

~/.bashrc on Linux or ~/.bash on MacOS

Test on the terminal (just paste it on the terminal and execute it):
content_copyenv LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c "16" | xargs
If the shell you use is bash, you can add it to ./bash_profile as follows:
content_copyalias gpw='genpasswd'
genpasswd() {
env LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c "16" | xargs
}
Remember to update source ~/.bash_profile take effect. Then we only need to enter gpw to generate a set of random passwords.
livewire/content-tags Tags: linux mac Devin Yang Feel free to ask me, if you don't get it.:) Follow livewire/comments No Comment Post your comment Login is required to leave comments
close livewire/similar-stories Similar Stories linux How to check apache loaded and enabled which modules? How to check apache loaded and enabled which modules? linux The error code returned by rsync All rsync error codes are listed here, so in scheduling, we can understand the reason for the failure. linux Generate ssh key pair without password query Sometimes it is necessary to generate an ssh key pair for automatic configuration. There is no password query in the command line, and an ssh key pair is generated. About Me Disclaimer Privacy Licenses © 2025, made with favorite by Devin Yang for a better web. livewire/content-search backspace × livewire/block-content-lists Run OpenSpeedTest with phpenv format_align_left Read Article About the operation of --env in Laravel's artisan This article uses Laravel 9.40.1 for operation. I believe many people know...more format_align_left Read Article Use HAProxy to remove the /mail path of the Sysnolgy Mail Station This article explains the version of DSM7. The Package Center of Synology...more format_align_left Read Article HAProxy and fastapi HAProxy can use the definition of acl to determine which backend the request should direct to. This ...more format_align_left Read Article How do I create a fastapi runtime environment with phpenv phpenv php laravel runs HAProxy, and automatically applies for and updates...more format_align_left Read Article livewire/content-pages ‹‹ 1 2 3 4 5 6 ... 50 51 ›› window.livewire = new Livewire();window.Livewire = window.livewire;window.livewire_app_url = '';window.livewire_token = 'WoXtkpqeZPnM3p1OYNwGXe7XsSZKYO0ED2ReCAVg';window.deferLoadingAlpine = function (callback) {window.addEventListener('livewire:load', function () {callback();});};let started = false;window.addEventListener('alpine:initializing', function () {if (! started) {window.livewire.start();started = true;}});document.addEventListener("DOMContentLoaded", function () {if (! started) {window.livewire.start();started = true;}}); /* var usertz = moment.tz.guess(); */ var searchStyle = function() { if ($(window).scrollTop() >= 100) { $("#search").parent().removeClass("has-white").addClass("has-rose"); $("#search").css({ 'color': 'gray' }); } else { $("#search").parent().removeClass("has-rose").addClass("has-white"); $("#search").css({ 'color': 'white' }); } if (window.width < 992) { $("#search").parent().removeClass("has-white").addClass("has-rose"); $("#search").css({ 'color': 'gray' }); } } $(window).resize(function() { if (document.body.clientWidth <= 992) { /* $("#search").parent().removeClass("has-white").addClass("has-rose"); $("#search").css({'color':'gray'}); */ //console.log(document.body.clientWidth); } }); var cleanSearch = function(e) { if (e.which == 21) { Livewire.emitTo('content-search', 'clean'); $("#search").focus(); } } document.getElementById("search").addEventListener("keyup", function(e) { cleanSearch(e); }); //searchStyle(); window.addEventListener('search-updated', event => { $("#search").focus(); }) $(document).on("keydown", function(e) { var code = e.keyCode; }); $(document).on("keypress", function(e) { if (!$("#search").is(":focus")) { console.log("B"); e.preventDefault(); } var code = e.keyCode; console.log(code); if (code == 47) { location.href = "/"; //$('#searchModal').modal('show'); } cleanSearch(e); }); var touchSearch = function(event) { $("#contentModal").modal("hide"); $(event.target).focus(); } $('#searchModal').on('shown.bs.modal', function() { $("#btnSearchModal").parent().fadeOut(); $('#search').trigger('focus'); }) $('#searchModal').on('hidden.bs.modal', function() { $("#btnSearchModal").parent().fadeIn(); $(document).trigger('focus'); }) var modalClose = function(modalId) { console.log("close modalId" + modalId); $("#" + modalId).modal("hide"); } $("#contentModal").on("shown.bs.modal", function(event) { var modal = $(this); modal.find("pre:has('code')").prepend('<span class="material-icons copy_code_to_text" onClick="copy_code_to_text(event,true)">content_copy</span>'); $("#contentModalCloseButton").show(); }); $('#contentModal').on('hidden.bs.modal', function() { var page = Livewire.emitTo('block-content-lists', 'getPage'); window.history.pushState('page', '3C Tech Center', "/?page=" + page); $("#contentModalCloseButton").hide(); }); Livewire.hook('element.initialized', (el, component) => { $("code").each(function(i, elm) { //Prism.highlightAll(elm); }); }) window.addEventListener('set-content-url', event => { var url = event.detail.url; var title = event.detail.title; var elm = $("div.modal-body").html(); $("#searchModal").modal("hide"); Prism.highlightAll(elm); FB.XFBML.parse(); try { window.history.pushState('page', title, url); document.title = title; } catch (e) { console.log(e); } $("#contentModal").modal("show"); }) //localStorage.clear(); var go_privacy = function() { localStorage.setItem("notify_cookie", "1"); location.href = "/privacy"; } var switch_lang = function(event,lang){ event.preventDefault(); const regex = /(^https:\/\/)\w+(\..+)/gm; var url = location.href.replace(regex,"\$1"+lang+"\$2"); location.href = url; } var cookie_notify = function() { toastr.options = { "closeButton": true, "debug": false, "newestOnTop": true, "progressBar": false, "positionClass": "toast-bottom-full-width", "preventDuplicates": false, "onclick": null, "showEasing": "swing", "hideEasing": "linear", "timeOut": 6000000, "extendedTimeOut": 6000000, "iconClasses": {"warning":"dark"} } if (localStorage.getItem("notify_cookie") == undefined) { toastr.warning( `In order to provide you with better services, this website uses cookies. By continuing to browse the web, you agree to our cookies policy. To understanding <button class='btn btn-danger btn-sm' onClick="go_privacy()" type="button" class='text-primary'><b>PRIVACY</b></button> ` ); } } cookie_notify(); if (window.history && history.pushState) { // check for history api support this.addEventListener('popstate', function(event, state) { modalClose('contentModal'); }); } var copy_code_to_text = function(event, is_modal=false) { toastr.remove() toastr.options = { "closeButton": false, "debug": false, "newestOnTop": false, "progressBar": true, "positionClass": "toast-top-right", "preventDuplicates": false, "onclick": null, "showDuration": "300", "hideDuration": "1000", "timeOut": "3000", "extendedTimeOut": "1000", "showEasing": "swing", "hideEasing": "linear", "showMethod": "fadeIn", "hideMethod": "fadeOut" } event.preventDefault(); var x = document.createElement("textarea"); if(is_modal){ var code = $(event.target).next(); console.log(code.text()); x.value = code.text(); $(event.target).append(x); x.select(); document.execCommand("copy"); x.remove(); }else{ x.value = $(event.target).parent().find("code").text(); document.body.appendChild(x); x.select(); document.execCommand("copy"); x.remove(); } toastr.info("已拷贝!") } $("pre:has('code')").prepend('<span class="material-icons copy_code_to_text" onClick="copy_code_to_text(event)">content_copy</span>');
In order to provide you with better services, this website uses cookies. By continuing to browse the web, you agree to our cookies policy. To understanding