Skip to content

Instantly share code, notes, and snippets.

@xiangruipuzhao
xiangruipuzhao / Trolltech.conf
Created March 17, 2020 08:20 — forked from booiiing/Trolltech.conf
~/.config/Trolltech.conf snippet with dark solarized palettes and custom colors
[Qt]
customColors\0=4278201142
customColors\1=4278662722
customColors\10=4285297092
customColors\11=4292032130
customColors\12=4287865249
customColors\13=4280983960
customColors\14=4294833891
customColors\15=4293847253
customColors\2=4291513110
#Install EPEL
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
sudo rpm -ivh epel-release-7-8.noarch.rpm
#Install X Windows and KDE
sudo yum -y groupinstall "X Window System" "KDE Desktop"
#Install and start xrdp
sudo yum -y install xrdp
sudo systemctl enable xrdp
@xiangruipuzhao
xiangruipuzhao / resources.md
Created August 29, 2019 13:57 — forked from fffaraz/resources.md
CS 306 - Linux/UNIX Programming
@xiangruipuzhao
xiangruipuzhao / mac_change.c
Created June 3, 2019 05:55 — forked from mad4j/mac_change.c
How to change MAC using ioctl
#include
#include <sys/ioctl.h>
#include
#include
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#include <net/if.h>
#include
#include
@xiangruipuzhao
xiangruipuzhao / defaultGatewayIoctlSet.c
Created May 6, 2019 05:53 — forked from lbuchy/defaultGatewayIoctlSet.c
Add default gateway route using ioctl
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <net/route.h>
#include <sys/types.h>
#include <sys/ioctl.h>
int main(char** args) {
int sockfd;
@xiangruipuzhao
xiangruipuzhao / tcp_server.c
Created December 20, 2018 03:28 — forked from oleksiiBobko/tcp_server.c
Simple socket server in C using threads (pthread library) Compiles on linux
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>
@xiangruipuzhao
xiangruipuzhao / A-Rails-Angular-install-node.sh
Created April 4, 2018 08:37 — forked from wellington1993/A-Rails-Angular-install-node.sh
Ubuntu instructions to install Node.js(+ npm) + AngularJS + YEOMAN + generator-angular + rbenv + Ruby + Rails-api - App Example: https://github.com/wellington1993/astronauta-test1-rails-angular
# Before this please install zsh and oh-my-zsh
apt-get install curl
#curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs vim htop git gitg
sudo add-apt-repository ppa:chris-lea/node.js
@xiangruipuzhao
xiangruipuzhao / linux_dump_text_to_hex
Created February 28, 2018 07:42 — forked from atupal/linux_dump_text_to_hex
linux下将文件转化为16进制。
linux中有多种方式可以将文件dump成16进制显示,也可以将16进制值再反向成文件。
$ hexdump test.txt
0000000 524f 2d41 3030 3036 0a30 524f 2d41 3030
0000010 3630 0a30
0000014
$ od -x test.txt
0000000 524f 2d41 3030 3036 0a30 524f 2d41 3030
0000020 3630 0a30
0000024
@xiangruipuzhao
xiangruipuzhao / gist:dbf73ac5030463db49692ceaad875b92
Created February 28, 2018 06:15 — forked from allex/gist:11203573
Ubuntu 安装中文字体

环境 (Environment)

版本:Ubuntu 14.04 LTS 默认语言:English(United States)

安装 (Setup)

Debian 和 Ubuntu 下对中文支持比较好的字体有: fonts-droid、ttf-wqy-zenhei 和 ttf-wqy-microhei 等,除了文泉驿系列字体外,比较流行的免费中文字体还有文鼎提供的楷体和上海宋,包名分别是: fonts-arphic-ukai 和 fonts-arphic-uming。