Skip to content

Instantly share code, notes, and snippets.

@zhanghai
zhanghai / myls.c
Last active January 15, 2017 11:30
A simple 'ls' program that mimics the behavior of `ls -ali`
/*
* A simple 'ls' program that mimics the behavior of `ls -ali`
* Copyright (C) 2014 Zhang Hai.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
@zhanghai
zhanghai / wlzju_login.sh
Last active August 29, 2015 14:01
Login script for ZJUWLAN
#!/bin/bash
USERNAME=
PASSWORD=
echo "Kicking other clients offline..."
response=$(curl 'https://net.zju.edu.cn/rad_online.php' -H 'Content-Type: application/x-www-form-urlencoded' -d "action=auto_dm&username=$USERNAME&password=$PASSWORD" -s)
if [[ "$response" != "ok" ]]; then
echo "$response"
exit 1