Skip to content

Instantly share code, notes, and snippets.

@syxc
syxc / openssh_upgrade.md
Last active July 2, 2024 10:43
openssh upgrade

CentOS 如何查看 OpenSSH 版本,以及如何升级,有哪些注意事项?

OpenSSH 爆高危漏洞 CVE-2024-6387

查看 CentOS 版本

在 CentOS 中,您可以通过多种方式查看版本号:

1. 使用 cat 命令查看 /etc/centos-release 文件:

@syxc
syxc / buildAndTest.yaml
Created May 14, 2024 05:09 — forked from felix-larsen/buildAndTest.yaml
iOS App with CocoaPods Test Automation with GitHub Actions CI
name: Build and Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
buildAndTest:
runs-on: macos-latest
steps:
@syxc
syxc / closeAppElegantly.swift
Created July 12, 2022 01:31 — forked from yoni-g/closeAppElegantly.swift
How to exit an iOS app without it looking like a crash? - Swift
func showMessageResetApp(){
let exitAppAlert = UIAlertController(title: "Restart is needed",
message: "We need to restart the app on your first login to the app.\n Please reopen the app after this.",
preferredStyle: .alert)
let resetApp = UIAlertAction(title: "Close Now", style: .destructive) {
(alert) -> Void in
// home button pressed programmatically - to thorw app to background
UIControl().sendAction(#selector(URLSessionTask.suspend), to: UIApplication.shared, for: nil)
// terminaing app in background
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjI4OTQ5OTEzMzggMC4zMTMzNjE2NzQ1IDAuMzYzNjI3ODIxMgAQAoAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.36362782120704651</real>
@syxc
syxc / ToggleButton.h
Last active October 31, 2015 12:51
简单的开关按钮实现
//
// ToggleButton.h
// FaceDemo
//
// Created by syxc on 15/10/31.
// Copyright © 2015年 syxc. All rights reserved.
//
#import <UIKit/UIKit.h>
@syxc
syxc / QQFacePanel.m
Created October 31, 2015 10:56
一个布局的例子,类似 QQ 表情面板
//
// ViewController.m
// FaceDemo
//
// Created by syxc on 15/10/31.
// Copyright © 2015年 syxc. All rights reserved.
//
#import "ViewController.h"
@syxc
syxc / Base64Coder.java
Created July 24, 2015 09:58
RSA encrypt/decrypt function (RSA / ECB / PKCS1-Padding)
//Copyright 2003-2009 Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland
//www.source-code.biz, www.inventec.ch/chdh
//
//This module is multi-licensed and may be used under the terms
//of any of the following licenses:
//
//EPL, Eclipse Public License, http://www.eclipse.org/legal
//LGPL, GNU Lesser General Public License, http://www.gnu.org/licenses/lgpl.html
//AL, Apache License, http://www.apache.org/licenses
//BSD, BSD License, http://www.opensource.org/licenses/bsd-license.php
@syxc
syxc / SimpleXOR.php
Created July 10, 2015 10:06
SimpleXOR for PHP
<?php
/**
* Created by PhpStorm.
* User: syxc
* Date: 15/7/10
* Time: 17:29
*/
class SimpleXOR
{
@syxc
syxc / xor.py
Created July 9, 2015 09:52
simpleXor
#!/usr/bin/env python
# encoding: utf-8
"""
xor.py
"""
import base64
def simpleXor(source, key):
retval = ''