Skip to content

Instantly share code, notes, and snippets.

@The-Yoda
The-Yoda / gist:eb9fc323436ca623a5c1c9d468950985
Created December 1, 2017 15:46
Mobile partner for Mac High Sierra
Disable csrutils:
Startup -> Cmd + R -> terminal -> `csrutil disable;reboot`
Download and install mobile partner:
http://download-c1.huawei.com/download/downloadCenter?downloadId=90143&version=352019&siteCode=worldwide
Create profile and connect.
for f in `find . -name "*.dust"`;do sed -i.bkp "s/label=\"{@pre editable=\"false\"/label=\"{@pre encode=\"true\"/" $f; done
for file in `find ./ -name "*.bak"`; do rm $file; done;
@The-Yoda
The-Yoda / bash_aliases
Created November 11, 2013 09:14
Aliases for bash
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
@The-Yoda
The-Yoda / Important-files-to-backup
Last active December 27, 2015 20:39
Files to backup before reinstalling ubuntu
In ~/
.bashrc
.bash_history
In gnome
with more plugins, .local/share/gnome-shell
app preferences(terminal key bindings, etc), .gconf
.viminfo
.vim_rc
.mozilla
@The-Yoda
The-Yoda / Rooting-vlc-evince
Created November 9, 2013 13:37
Opening vlc and evince (document reader) as root
Opening evince as root :
sudo ln -s /etc/apparmor.d/usr.bin.evince /etc/apparmor.d/disable
sudo /etc/init.d/apparmor restart
opening vlc as root :
change geteuid to getppid in /usr/bin/vlc
@The-Yoda
The-Yoda / hotspot
Created November 9, 2013 05:37
Creating hotspot in ubuntu 12.04
/etc/hostapd/hostapd.conf
interface=wlan1
driver=nl80211
ssid=hotspot
hw_mode=g
channel=1
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
@The-Yoda
The-Yoda / Method names
Created November 9, 2013 05:33
Scala: Getting method names of a class
//obj is object of a class
var params : Array[String] = obj.getClass.getMethods.map(_.getName)
var j : Int = 0
while ({j < params.length}){
println(params(j))
j = j + 1
}
@The-Yoda
The-Yoda / gist:6350172
Created August 27, 2013 06:12
To remove errors because of constants in phpunit
public function prepareTemplate( Text_Template $template ) {
$template->setVar( array(
'constants' => '',
'zz_constants' => PHPUnit_Util_GlobalState::getConstantsAsString()
));
parent::prepareTemplate( $template );
}
@The-Yoda
The-Yoda / SoftwaresToBeInstalledInUbuntu
Last active December 18, 2015 21:38
Softwares to be installed after reinstalling ubuntu
If you are gonna use same version of ubuntu, before installing take backup of software names using :
dpkg --get-selections > installed-software
After installing use following commands:
dpkg --set-selections < installed-softwares
apt-get -u dselect-upgrade
Installing java :
openjdk-7-jdk
or for sun java,
@The-Yoda
The-Yoda / gist:5316791
Created April 5, 2013 05:11
Android Async http connection sample code
class GetJSONFromUrl extends AsyncTask<String, Void, RSSFeed> {
InputStream is = null;
String result = "";
String error_text="";
JSONObject j = null;
protected void doInBackground(String... urls) {
// http post