Skip to content

Instantly share code, notes, and snippets.

Dipesh Acharya xtranophilist

Block or report user

Report or block xtranophilist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ssh-hardening.sh
sudo su
vi /etc/ssh/sshd_config
Port xxx
PermitRootLogin no
AllowUsers yyy
service sshd restart
deluser --remove-home ubuntu
@xtranophilist
xtranophilist / sms
Created Apr 12, 2013
Android SMS backup/restore w/ adb
View sms
#Backup:
adb remount
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db mmssms.db
#Restore:
adb remount
adb push mmssms.db /data/data/com.android.providers.telephony/databases/mmssms.db
@xtranophilist
xtranophilist / install-b43.sh
Last active Jun 20, 2019
Install Broadcom (B43) wireless driver in Linux
View install-b43.sh
#!/bin/bash
#http://wireless.kernel.org/en/users/Drivers/b43
su -
yum install b43-fwcutter wget # apt-get or whatever your package manager is
export FIRMWARE_INSTALL_DIR="/lib/firmware"
wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2
tar xjf broadcom-wl-5.100.138.tar.bz2
sudo b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" broadcom-wl-5.100.138/linux/wl_apsta.o
echo 'modprobe b43' > /etc/sysconfig/modules/b43.modules
@xtranophilist
xtranophilist / install-mscorefonts.sh
Created Dec 27, 2012
Install 'Times New Roman' and other proprietary fonts in Fedora
View install-mscorefonts.sh
yum install rpm-build cabextract ttmkfdir
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec
rpmbuild -bb msttcorefonts-2.5-1.spec
rpm -ivh $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm
fc-cache -f -v
View ko_selectize.js
var inject_binding = function (allBindings, key, value) {
//https://github.com/knockout/knockout/pull/932#issuecomment-26547528
return {
has: function (bindingKey) {
return (bindingKey == key) || allBindings.has(bindingKey);
},
get: function (bindingKey) {
var binding = allBindings.get(bindingKey);
if (bindingKey == key) {
binding = binding ? [].concat(binding, value) : value;
@xtranophilist
xtranophilist / _pagination.html
Last active Jan 17, 2019
Bootstrap 4 Pagination template for django-pure-pagination
View _pagination.html
{% load i18n %}
{% if is_paginated %}
<nav aria-label="navigation" class="p-3">
<ul class="pagination">
{% if page_obj.has_previous %}
<li class="page-item">
<a href="?{{ page_obj.previous_page_number.querystring }}"
class="page-link previous">&lsaquo;&lsaquo; {% trans "Previous" %}</a>
</li>
{% else %}
@xtranophilist
xtranophilist / ko-chosen.js
Last active Jan 11, 2019
Collection of Knockout.js custom bindings.
View ko-chosen.js
//http://stackoverflow.com/questions/13210663/how-to-order-knockout-bindings
ko.bindingHandlers.chosen = {
init: function(element, valueAccessor, allBindingsAccessor, viewModel) {
var allBindings = allBindingsAccessor();
var options = {default: 'Select one...'};
$.extend(options, allBindings.chosen)
$(element).attr('data-placeholder', options.default);
@xtranophilist
xtranophilist / pacman-aria2.conf
Created Jul 8, 2015
pacman and aria2 configuration
View pacman-aria2.conf
# good balance between details and readability : https://bbs.archlinux.org/viewtopic.php?pid=1491879#p1491879 #archlinux
# vim /etc/pacman.conf
# XferCommand = echo Downloading %u ... && /usr/bin/aria2c --conf-path=/root/.aria2/pacman-aria2.conf %u
# /root/.aria2/pacman-aria2.conf
connect-timeout=30
max-tries=5
retry-wait=10
@xtranophilist
xtranophilist / provinces_districts.json
Created Apr 10, 2018
Provinces and Districts of Nepal [WIP]
View provinces_districts.json
[
{
"province": "1",
"name": "Sagarmatha",
"districts": [
"Bhojpur",
"Dhankuta",
"Ilam",
"Jhapa",
"Khotang",
@xtranophilist
xtranophilist / ubuntu_cleanup.sh
Created Apr 4, 2018
Ubuntu 16.04 Initial Cleanup
View ubuntu_cleanup.sh
sudo apt purge snapd ubuntu-core-launcher squashfs-tools
sudo apt-get purge --auto-remove friendly-recovery
sudo apt-get purge --auto-remove unattended-upgrades
sudo apt-get purge --auto-remove ureadahead
sudo apt-get purge --auto-remove apport
sudo systemctl disable apt-daily-upgrade.timer
sudo systemctl mask apt-daily-upgrade.service
sudo systemctl disable apt-daily.timer
sudo systemctl mask apt-daily.service
You can’t perform that action at this time.