This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf8 | |
from argparse import ArgumentParser | |
def color_str(o_str, color_num): | |
return '\033[1;{}m{}\033[m'.format(color_num, o_str) | |
def red_str(o_str): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
latestkernel=`ls -t /boot/vmlinuz-* | sed "s/\/boot\/vmlinuz-//g" | head -n1` | |
echo $latestkernel | |
kexec -l /boot/vmlinuz-${latestkernel} --initrd=/boot/initramfs-${latestkernel}.img --append="`cat /proc/cmdline`" | |
kexec -e | |
# 备注,其实和重启没啥两样, uptime也会清零重算,唯一的好处就是比重启要快一点点 | |
# remove old kernels on centos 8 | |
dnf remove --oldinstallonly --setopt installonly_limit=1 kernel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Checkbox } from '@shopify/polaris' | |
export default function CheckboxAdapter({ input, meta, ...rest }) { | |
return ( | |
<Checkbox | |
{...input} | |
{...rest} | |
error={meta.touched && meta.error} | |
onChange={(value) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2020 Petrukhin Pavel | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module github.com/sempr/gin-reverse-proxy | |
go 1.18 | |
require github.com/gin-gonic/gin v1.8.1 | |
require ( | |
github.com/gin-contrib/sse v0.1.0 // indirect | |
github.com/go-playground/locales v0.14.0 // indirect | |
github.com/go-playground/universal-translator v0.18.0 // indirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Update dat files | |
hosts: all | |
become: yes | |
vars: | |
- base_path: /etc/mosdns | |
- restart_daemon: yes | |
- daemon_service_name: mosdns | |
- clean_up_after: yes |