Skip to content

Instantly share code, notes, and snippets.

View esmaeelE's full-sized avatar
🎯
Focusing

esmaeelE esmaeelE

🎯
Focusing
View GitHub Profile
@esmaeelE
esmaeelE / UBUNTU 17.04 change repo
Created May 14, 2018 18:55
/etc/apt/sources.list
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
@esmaeelE
esmaeelE / XFCE Hide-Show Desktop icons
Last active October 3, 2019 13:52
Run bash script to switch between show/hide desktop icons
#!/bin/bash
OUTPUT="$(xfconf-query -c xfce4-desktop -p '/desktop-icons/style' -a)"
if [ "$OUTPUT" -eq "0" ]; then
echo "Show Desktop icons"
xfconf-query -c xfce4-desktop -np '/desktop-icons/style' -t 'int' -s '2'
elif [ "$OUTPUT" -eq "2" ];
then

Remove 'com' substring from all lines

cat file.txt | sed 's/com//g' >newfile.txt

/* This file is part of:
* Jalali, a Gregorian to Jalali and inverse date convertor
* Copyright (C) 2001 Roozbeh Pournader <roozbeh@sharif.edu>
* Copyright (C) 2001 Mohammad Toossi <mohammad@bamdad.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
@esmaeelE
esmaeelE / bicon.md
Last active January 27, 2020 11:40

Install bicon

pre-request

sudo apt install libfribidi0 libfribidi-dev

Download, exctract, install

behad bicon

`./autogen.sh ./configure

echo "salam samad dasads"|grep -o "a"|wc -l

C

	char str[]="aaaHello world";
	int a = 0;
	
	int i=0;

lsb_release -a

uname -a

screenfetch

hostnamectl

cat /etc/os-release

Printable ASCII charackters

awk 'BEGIN{for( i=32; i<=126;i++) printf "%c",i }'

#!/bin/bash
# usage ./mdia_suration.sh $(pwd) mp4
len=0;
for f in $1/*.$2; do
echo -ne "$f\t";
dur=`ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$f"`;
number=`echo "$dur/1" | bc`;
printf '%dh:%dm:%ds\n\n' $(($number/3600)) $(($number%3600/60)) $(($number%60))

Remove old version

sudo apt purge libreoffice

sudo mv ~/.config/libreoffice/ ~/.config/libreoffice-back/

download latest version

https://www.libreoffice.org/download/download/?type=deb-x86_64&version=6.4.1&lang=en-US

extract

tar -xf LibreOffice_6.4.1_Linux_x86-64_deb.tar.gz