Skip to content

Instantly share code, notes, and snippets.

View zdyxry's full-sized avatar
🖖
Focusing

Yiran Zhou zdyxry

🖖
Focusing
View GitHub Profile
function rcode() {
local target_path="$1"
VSCODE_SERVER_PATH="${HOME}/.vscode-server"
VSCODE_SERVER_BIN_PATH="${VSCODE_SERVER_PATH}/bin"
VSCODE_SERVER_BIN_CURRENT_PATH="${VSCODE_SERVER_BIN_PATH}/$(ls -t ${VSCODE_SERVER_BIN_PATH} | head -n 1)"
VSCODE_IPC_HOOK_CLI=$(ss -l |grep vscode-ipc |tail -n 1 | awk '{print $5}')
VSCODE_IPC_HOOK_CLI=$VSCODE_IPC_HOOK_CLI ${VSCODE_SERVER_BIN_CURRENT_PATH}/bin/remote-cli/code ${target_path}
}
@zdyxry
zdyxry / csv2json.py
Created July 7, 2018 08:18
Convert csv file to nested json file. Reference: https://github.com/chamkank/hone
#!/usr/bin/python
# MIT License
# Copyright (c) 2018 CK
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@zdyxry
zdyxry / rpm_check.yml
Created May 22, 2017 01:03
Check if some rpm is installed
#!/usr/bin/env ansible-playbook
---
- name: rpm_check
hosts: test_vm
tasks:
- name: copy the_silver_searcher rpm
copy: src=/opt/the_silver_searcher-0.33.0-1.el7.x86_64.rpm dest=/opt/the_silver_searcher-0.33.0-1.el7.x86_64.rpm
- name: Check if ag.rpm is installed
command: rpm -q the_silver_searcher