Skip to content

Instantly share code, notes, and snippets.

@npeters
npeters / progressbar.sh
Created August 9, 2014 19:32
Progress bar sh
echo -ne '##### (33%)\r'
sleep 1
echo -ne '############# (66%)\r'
sleep 1
echo -ne '####################### (100%)\r'
echo -ne '\n'
@npeters
npeters / install-instance.sh
Last active June 16, 2020 07:42
Setup Yum Repo
# script instance
echo 172.23.113.5 vod-rpm >> /etc/hosts
sed -i 's/name=/enabled=0\nname=/g' /etc/yum.repos.d/*.repo
#add repo
cat << EOF > /etc/yum.repos.d/vod-centos6.repo
[VodCentos6-Repository]
name=Vod Centos6 - Local
baseurl=http://vod-rpm/centos6/Packages
@npeters
npeters / Linux Bluetooth
Created January 8, 2017 22:20
Linux Bluetooth
- tools:
bluetoothctl
connect
scan
trust
- headset:
apt install pulseaudio-module-bluetooth
@npeters
npeters / mycanal-live.js
Last active January 4, 2017 22:58
mycanal resize window
window.body.style.overflow="hidden";
d = document.querySelector('#one-player > div');
d.style.width = "100%";
//d.style.heigth = "100%"
d.style.bottom="0px";
document.querySelector("#lb").style.width="100%";
@npeters
npeters / VSCode Debug launch.json
Last active June 24, 2016 14:10
TypeScript + Webpack + vscode + chrome-debug
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"type": "chrome",
"request": "attach",
"port": 9222,
"webRoot": "${workspaceRoot}/target",
"url": "http://localhost:8080/",
@npeters
npeters / script Hibernate
Last active June 2, 2016 19:19
Linux Hibernate
http://ubuntuhandbook.org/index.php/2014/04/enable-hibernate-ubuntu-14-04/
http://askubuntu.com/questions/761394/why-isnt-hibernate-in-ubuntu-16-04-working-and-how-to-fix-it
http://ubuntuforums.org/showthread.php?t=1042946
```
tail -n -9 /proc/swaps | cut -d ' ' -f 1 | xargs sudo blkid
mount | grep " / " ;# Note your /dev/... on /
sudo blkid -g
sudo blkid ;## get / -> /dev/... -> partition UUID -> resume=UUID=
sudo filefrag -v /swapfile | grep "First block:" ;## get First block -> resume_offset
@npeters
npeters / gist:7910898
Created December 11, 2013 14:02
tig config
[tig]
line-graphics = ascii
show-author = abbreviated # Show abbreviated author names.
show-date = local # Show relative commit date.
show-rev-graph = yes # Show revision graph?
show-refs = yes # Show references?
commit-order = topo # Order commits topologically
read-git-colors = no # Do not read Git's color settings.
show-line-numbers = no # Show line numbers?
line-number-interval = 2 # Interval between line numbers
@npeters
npeters / gist:7826852
Created December 6, 2013 15:44
Valider le format d un xml
xmllint.exe --format --noout pom.xml
@npeters
npeters / gist:7672114
Created November 27, 2013 07:56
git command
git ls-files --other --exclude-standard
~/bin/git-st-mvn.sh
moduleList=$(git st | grep src | sed "s/#//" | sed "s/.*://" |sed "s/\s//g" | egrep -o .*src | awk '{print substr($_,0,length($_)-4)}' | sort | uniq)
echo $moduleList | sed "s/ /,/g"
ou
moduleList=$(git st | grep src | sed -r "s/^#.*:\s*(.*)\/src.*/\1/g")
echo $moduleList | sed "s/ /,/g"
@npeters
npeters / gist:7671982
Created November 27, 2013 07:37
git config
[gc]
auto = 1
[user]
email =
name = npeters
[alias]
st = status
ci = commit
br = branch
co = checkout